Assert validates data type of a specified column. Assert will fail if data type do not match.

Arguments

  • v_ObjectName – table name, Variable Character(255) in Oracle and Netezza, SYSNAME in SQL Server
  • v_ColumnName – name of the column, Variable Character(255) in Oracle and Netezza, SYSNAME in SQL Server
  • v_ColumnType - Column Type. Type should not include precision and scale information. 
  • v_UserMessage – message to report when assertion fails, Variable Character(255) in Oracle and Netezza, NVARCHAR(MAX) in SQL Server

Examples

SQL Server 

CREATE PROCEDURE UT_DDLSuite_CreditQuality_Columns
AS
BEGIN
    EXEC DBTD_UNIT_TEST 'DDLSuite';
    EXEC DBTD_ASSERT_COLUMN_TYPE
        'CreditQuality', 'AAA', 'NUMERIC', 'Type is incorrect';

    EXEC DBTD_ASSERT_COLUMN_TYPE
        'CreditQuality', 'AA', 'NUMERIC', 'Type is incorrect';
END;

Oracle 

      DBTD_ASSERT_COLUMN_TYPE (‘myTable’, ‘ID’, ‘INT’ ‘Incorrect type’);

Netezza

      CALL DBTD_ASSERT_COLUMN_TYPE (‘myTable’, ‘ID’, ‘INT’ ‘Incorrect type’);

 


See Also