/**Begin D:\PDM_UPGRADE_1.3\PDM_UPGRADE\pdm1\RIM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_ELECTRIC' AND KSQL_COL_NAME ='FTAX_RECORDED_STATUS') 
 ALTER TABLE T_RIM_INV_ELECTRIC ADD (FTAX_RECORDED_STATUS NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_ELECTRIC' AND KSQL_COL_NAME ='FTAX_RECORDED_PURPOSE') 
 ALTER TABLE T_RIM_INV_ELECTRIC ADD (FTAX_RECORDED_PURPOSE NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_ELECTRIC' AND KSQL_COL_NAME ='FTAX_RECORDED_TIME') 
 ALTER TABLE T_RIM_INV_ELECTRIC ADD (FTAX_RECORDED_TIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_ELECTRIC' AND KSQL_COL_NAME ='FSPECIAL_TYPE_MARK') 
 ALTER TABLE T_RIM_INV_ELECTRIC ADD (FSPECIAL_TYPE_MARK NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_ELECTRIC' AND KSQL_COL_NAME ='FAGRIC_HANDLE_STATUS') 
 ALTER TABLE T_RIM_INV_ELECTRIC ADD (FAGRIC_HANDLE_STATUS NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_ELECTRIC' AND KSQL_COL_NAME ='FAGRIC_PREHANDLETYPE') 
 ALTER TABLE T_RIM_INV_ELECTRIC ADD (FAGRIC_PREHANDLETYPE NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_ELECTRIC' AND KSQL_COL_NAME ='FAGRIC_PARTIAL_AMOUNT') 
 ALTER TABLE T_RIM_INV_ELECTRIC ADD (FAGRIC_PARTIAL_AMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_ELECTRIC' AND KSQL_COL_NAME ='FAGRIC_PARTIAL_TAXAMOUNT') 
 ALTER TABLE T_RIM_INV_ELECTRIC ADD (FAGRIC_PARTIAL_TAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_ELECTRIC' AND KSQL_COL_NAME ='FSALER_TYPE') 
 ALTER TABLE T_RIM_INV_ELECTRIC ADD (FSALER_TYPE NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_MOTOR' AND KSQL_COL_NAME ='FTAX_RECORDED_STATUS') 
 ALTER TABLE T_RIM_INV_MOTOR ADD (FTAX_RECORDED_STATUS NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_MOTOR' AND KSQL_COL_NAME ='FTAX_RECORDED_PURPOSE') 
 ALTER TABLE T_RIM_INV_MOTOR ADD (FTAX_RECORDED_PURPOSE NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_MOTOR' AND KSQL_COL_NAME ='FTAX_RECORDED_TIME') 
 ALTER TABLE T_RIM_INV_MOTOR ADD (FTAX_RECORDED_TIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_TRAIN_ELE' AND KSQL_COL_NAME ='FTAX_RECORDED_STATUS') 
 ALTER TABLE T_RIM_INV_TRAIN_ELE ADD (FTAX_RECORDED_STATUS NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_TRAIN_ELE' AND KSQL_COL_NAME ='FTAX_RECORDED_PURPOSE') 
 ALTER TABLE T_RIM_INV_TRAIN_ELE ADD (FTAX_RECORDED_PURPOSE NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_TRAIN_ELE' AND KSQL_COL_NAME ='FTAX_RECORDED_TIME') 
 ALTER TABLE T_RIM_INV_TRAIN_ELE ADD (FTAX_RECORDED_TIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_ORDINARY' AND KSQL_COL_NAME ='FTAX_RECORDED_STATUS') 
 ALTER TABLE T_RIM_INV_ORDINARY ADD (FTAX_RECORDED_STATUS NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_ORDINARY' AND KSQL_COL_NAME ='FTAX_RECORDED_PURPOSE') 
 ALTER TABLE T_RIM_INV_ORDINARY ADD (FTAX_RECORDED_PURPOSE NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_ORDINARY' AND KSQL_COL_NAME ='FTAX_RECORDED_TIME') 
 ALTER TABLE T_RIM_INV_ORDINARY ADD (FTAX_RECORDED_TIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_ORDINARY' AND KSQL_COL_NAME ='FSPECIAL_TYPE_MARK') 
 ALTER TABLE T_RIM_INV_ORDINARY ADD (FSPECIAL_TYPE_MARK NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_ORDINARY' AND KSQL_COL_NAME ='FAGRIC_HANDLE_STATUS') 
 ALTER TABLE T_RIM_INV_ORDINARY ADD (FAGRIC_HANDLE_STATUS NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_ORDINARY' AND KSQL_COL_NAME ='FAGRIC_PREHANDLETYPE') 
 ALTER TABLE T_RIM_INV_ORDINARY ADD (FAGRIC_PREHANDLETYPE NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_ORDINARY' AND KSQL_COL_NAME ='FAGRIC_PARTIAL_AMOUNT') 
 ALTER TABLE T_RIM_INV_ORDINARY ADD (FAGRIC_PARTIAL_AMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_ORDINARY' AND KSQL_COL_NAME ='FAGRIC_PARTIAL_TAXAMOUNT') 
 ALTER TABLE T_RIM_INV_ORDINARY ADD (FAGRIC_PARTIAL_TAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_ORDINARY' AND KSQL_COL_NAME ='FSALER_TYPE') 
 ALTER TABLE T_RIM_INV_ORDINARY ADD (FSALER_TYPE NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_SPECIAL' AND KSQL_COL_NAME ='FTAX_RECORDED_STATUS') 
 ALTER TABLE T_RIM_INV_SPECIAL ADD (FTAX_RECORDED_STATUS NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_SPECIAL' AND KSQL_COL_NAME ='FTAX_RECORDED_PURPOSE') 
 ALTER TABLE T_RIM_INV_SPECIAL ADD (FTAX_RECORDED_PURPOSE NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_SPECIAL' AND KSQL_COL_NAME ='FTAX_RECORDED_TIME') 
 ALTER TABLE T_RIM_INV_SPECIAL ADD (FTAX_RECORDED_TIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_SPECIAL' AND KSQL_COL_NAME ='FSPECIAL_TYPE_MARK') 
 ALTER TABLE T_RIM_INV_SPECIAL ADD (FSPECIAL_TYPE_MARK NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_SPECIAL' AND KSQL_COL_NAME ='FAGRIC_HANDLE_STATUS') 
 ALTER TABLE T_RIM_INV_SPECIAL ADD (FAGRIC_HANDLE_STATUS NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_SPECIAL' AND KSQL_COL_NAME ='FAGRIC_PREHANDLETYPE') 
 ALTER TABLE T_RIM_INV_SPECIAL ADD (FAGRIC_PREHANDLETYPE NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_SPECIAL' AND KSQL_COL_NAME ='FAGRIC_PARTIAL_AMOUNT') 
 ALTER TABLE T_RIM_INV_SPECIAL ADD (FAGRIC_PARTIAL_AMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_SPECIAL' AND KSQL_COL_NAME ='FAGRIC_PARTIAL_TAXAMOUNT') 
 ALTER TABLE T_RIM_INV_SPECIAL ADD (FAGRIC_PARTIAL_TAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_SPECIAL' AND KSQL_COL_NAME ='FSALER_TYPE') 
 ALTER TABLE T_RIM_INV_SPECIAL ADD (FSALER_TYPE NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_TOLL' AND KSQL_COL_NAME ='FTAX_RECORDED_STATUS') 
 ALTER TABLE T_RIM_INV_TOLL ADD (FTAX_RECORDED_STATUS NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_TOLL' AND KSQL_COL_NAME ='FTAX_RECORDED_PURPOSE') 
 ALTER TABLE T_RIM_INV_TOLL ADD (FTAX_RECORDED_PURPOSE NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_TOLL' AND KSQL_COL_NAME ='FTAX_RECORDED_TIME') 
 ALTER TABLE T_RIM_INV_TOLL ADD (FTAX_RECORDED_TIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_USEDCAR' AND KSQL_COL_NAME ='FTAX_RECORDED_STATUS') 
 ALTER TABLE T_RIM_INV_USEDCAR ADD (FTAX_RECORDED_STATUS NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_USEDCAR' AND KSQL_COL_NAME ='FTAX_RECORDED_PURPOSE') 
 ALTER TABLE T_RIM_INV_USEDCAR ADD (FTAX_RECORDED_PURPOSE NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_USEDCAR' AND KSQL_COL_NAME ='FTAX_RECORDED_TIME') 
 ALTER TABLE T_RIM_INV_USEDCAR ADD (FTAX_RECORDED_TIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INVOICE' AND KSQL_COL_NAME ='FTAX_RECORDED_STATUS') 
 ALTER TABLE T_RIM_INVOICE ADD (FTAX_RECORDED_STATUS NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INVOICE' AND KSQL_COL_NAME ='FTAX_RECORDED_PURPOSE') 
 ALTER TABLE T_RIM_INVOICE ADD (FTAX_RECORDED_PURPOSE NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INVOICE' AND KSQL_COL_NAME ='FTAX_RECORDED_TIME') 
 ALTER TABLE T_RIM_INVOICE ADD (FTAX_RECORDED_TIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INVOICE' AND KSQL_COL_NAME ='FSPECIAL_TYPE_MARK') 
 ALTER TABLE T_RIM_INVOICE ADD (FSPECIAL_TYPE_MARK NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INVOICE' AND KSQL_COL_NAME ='FPURCHASE_TICKET') 
 ALTER TABLE T_RIM_INVOICE ADD (FPURCHASE_TICKET NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INVOICE' AND KSQL_COL_NAME ='FAGRIC_HANDLE_STATUS') 
 ALTER TABLE T_RIM_INVOICE ADD (FAGRIC_HANDLE_STATUS NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INVOICE' AND KSQL_COL_NAME ='FAGRIC_PREHANDLETYPE') 
 ALTER TABLE T_RIM_INVOICE ADD (FAGRIC_PREHANDLETYPE NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INVOICE' AND KSQL_COL_NAME ='FAGRIC_PARTIAL_AMOUNT') 
 ALTER TABLE T_RIM_INVOICE ADD (FAGRIC_PARTIAL_AMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INVOICE' AND KSQL_COL_NAME ='FAGRIC_PARTIAL_TAXAMOUNT') 
 ALTER TABLE T_RIM_INVOICE ADD (FAGRIC_PARTIAL_TAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_ORDINARY' AND KSQL_COL_NAME ='FDEDUCTION_PURPOSE')
ALTER TABLE T_RIM_INV_ORDINARY ADD (FDEDUCTION_PURPOSE NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_ORDINARY' AND KSQL_COL_NAME ='FMANAGE_STATUS')
ALTER TABLE T_RIM_INV_ORDINARY ADD (FMANAGE_STATUS NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_ORDINARY' AND KSQL_COL_NAME ='FAUTHENTICATE_FLAG')
ALTER TABLE T_RIM_INV_ORDINARY ADD (FAUTHENTICATE_FLAG NVARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_ORDINARY' AND KSQL_COL_NAME ='FSELECT_TIME')
ALTER TABLE T_RIM_INV_ORDINARY ADD (FSELECT_TIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_ORDINARY' AND KSQL_COL_NAME ='FNOT_DEDUCTIBLE_TYPE')
ALTER TABLE T_RIM_INV_ORDINARY ADD (FNOT_DEDUCTIBLE_TYPE NVARCHAR(2) DEFAULT ' ' NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_SELECT_ACCOUNT' AND KSQL_COL_NAME ='FAGRIC_PARTIAL_AMOUNT')
ALTER TABLE T_RIM_SELECT_ACCOUNT ADD (FAGRIC_PARTIAL_AMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_SELECT_ACCOUNT' AND KSQL_COL_NAME ='FAGRIC_PARTIAL_TAXAMOUNT')
ALTER TABLE T_RIM_SELECT_ACCOUNT ADD (FAGRIC_PARTIAL_TAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_ELECTRIC' AND KSQL_COL_NAME ='FRECORDED_MXUUID')
ALTER TABLE T_RIM_INV_ELECTRIC ADD (FRECORDED_MXUUID NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_ELECTRIC' AND KSQL_COL_NAME ='FRECORDED_RZUUID')
ALTER TABLE T_RIM_INV_ELECTRIC ADD (FRECORDED_RZUUID NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_MOTOR' AND KSQL_COL_NAME ='FRECORDED_MXUUID')
ALTER TABLE T_RIM_INV_MOTOR ADD (FRECORDED_MXUUID NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_MOTOR' AND KSQL_COL_NAME ='FRECORDED_RZUUID')
ALTER TABLE T_RIM_INV_MOTOR ADD (FRECORDED_RZUUID NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_TRAIN_ELE' AND KSQL_COL_NAME ='FRECORDED_MXUUID')
ALTER TABLE T_RIM_INV_TRAIN_ELE ADD (FRECORDED_MXUUID NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_TRAIN_ELE' AND KSQL_COL_NAME ='FRECORDED_RZUUID')
ALTER TABLE T_RIM_INV_TRAIN_ELE ADD (FRECORDED_RZUUID NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_ORDINARY' AND KSQL_COL_NAME ='FRECORDED_MXUUID')
ALTER TABLE T_RIM_INV_ORDINARY ADD (FRECORDED_MXUUID NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_ORDINARY' AND KSQL_COL_NAME ='FRECORDED_RZUUID')
ALTER TABLE T_RIM_INV_ORDINARY ADD (FRECORDED_RZUUID NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_SPECIAL' AND KSQL_COL_NAME ='FRECORDED_MXUUID')
ALTER TABLE T_RIM_INV_SPECIAL ADD (FRECORDED_MXUUID NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_SPECIAL' AND KSQL_COL_NAME ='FRECORDED_RZUUID')
ALTER TABLE T_RIM_INV_SPECIAL ADD (FRECORDED_RZUUID NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_TOLL' AND KSQL_COL_NAME ='FRECORDED_MXUUID')
ALTER TABLE T_RIM_INV_TOLL ADD (FRECORDED_MXUUID NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_TOLL' AND KSQL_COL_NAME ='FRECORDED_RZUUID')
ALTER TABLE T_RIM_INV_TOLL ADD (FRECORDED_RZUUID NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_USEDCAR' AND KSQL_COL_NAME ='FRECORDED_MXUUID')
ALTER TABLE T_RIM_INV_USEDCAR ADD (FRECORDED_MXUUID NVARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_RIM_INV_USEDCAR' AND KSQL_COL_NAME ='FRECORDED_RZUUID')
ALTER TABLE T_RIM_INV_USEDCAR ADD (FRECORDED_RZUUID NVARCHAR(100) DEFAULT ' ' NOT NULL );

/**End D:\PDM_UPGRADE_1.3\PDM_UPGRADE\pdm1\RIM_table.sql **/
