 EXEC p_AlterColumn 'T_RIM_INV_AIR_ELE', 'FENDORSEMENT', 'NVARCHAR(50)', 'NOT NULL', '0100', ''' ''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_AIR_ELE' AND KSQL_COL_NAME ='FDEDUCTION_PURPOSE')
 ALTER TABLE T_RIM_INV_AIR_ELE ADD (FDEDUCTION_PURPOSE NVARCHAR(4) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_AIR_ELE' AND KSQL_COL_NAME ='FDEDUCTION_FLAG')
 ALTER TABLE T_RIM_INV_AIR_ELE ADD (FDEDUCTION_FLAG NVARCHAR(4) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_AIR_ELE' AND KSQL_COL_NAME ='FNOT_DEDUCTIBLE_TYPE')
 ALTER TABLE T_RIM_INV_AIR_ELE ADD (FNOT_DEDUCTIBLE_TYPE NVARCHAR(4) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_AIR_ELE' AND KSQL_COL_NAME ='FTRANSPORT_DEDUCTION')
 ALTER TABLE T_RIM_INV_AIR_ELE ADD (FTRANSPORT_DEDUCTION NVARCHAR(4) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_AIR_ELE' AND KSQL_COL_NAME ='FEFFECTIVE_TAX_AMOUNT')
 ALTER TABLE T_RIM_INV_AIR_ELE ADD (FEFFECTIVE_TAX_AMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_TRAIN_ELE' AND KSQL_COL_NAME ='FSEAT')
 ALTER TABLE T_RIM_INV_TRAIN_ELE ADD (FSEAT NVARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_TRAIN_ELE' AND KSQL_COL_NAME ='FDEDUCTION_PURPOSE')
 ALTER TABLE T_RIM_INV_TRAIN_ELE ADD (FDEDUCTION_PURPOSE NVARCHAR(4) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_TRAIN_ELE' AND KSQL_COL_NAME ='FDEDUCTION_FLAG')
 ALTER TABLE T_RIM_INV_TRAIN_ELE ADD (FDEDUCTION_FLAG NVARCHAR(4) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_TRAIN_ELE' AND KSQL_COL_NAME ='FNOT_DEDUCTIBLE_TYPE')
 ALTER TABLE T_RIM_INV_TRAIN_ELE ADD (FNOT_DEDUCTIBLE_TYPE NVARCHAR(4) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_TRAIN_ELE' AND KSQL_COL_NAME ='FTRANSPORT_DEDUCTION')
 ALTER TABLE T_RIM_INV_TRAIN_ELE ADD (FTRANSPORT_DEDUCTION NVARCHAR(4) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_TRAIN_ELE' AND KSQL_COL_NAME ='FEFFECTIVE_TAX_AMOUNT')
 ALTER TABLE T_RIM_INV_TRAIN_ELE ADD (FEFFECTIVE_TAX_AMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
