/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\CAS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_RECPAYRULE_E' AND KSQL_COL_NAME ='FPAYERID') 
 ALTER TABLE T_CAS_RECPAYRULE_E ADD (FPAYERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_RECPAYRULE_E' AND KSQL_COL_NAME ='FPAYERBASETYPE') 
 ALTER TABLE T_CAS_RECPAYRULE_E ADD (FPAYERBASETYPE NVARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_RECPAYRULE_E' AND KSQL_COL_NAME ='FPAYER') 
 ALTER TABLE T_CAS_RECPAYRULE_E ADD (FPAYER NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_RECPAYRULE_E' AND KSQL_COL_NAME ='FSAVENOTIFI_TAG') 
 ALTER TABLE T_CAS_RECPAYRULE_E ADD (FSAVENOTIFI_TAG NCLOB );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_RECPAYRULE_E' AND KSQL_COL_NAME ='FSAVENOTIFI') 
 ALTER TABLE T_CAS_RECPAYRULE_E ADD (FSAVENOTIFI NCLOB );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_RECPAYRULE_E' AND KSQL_COL_NAME ='FHANDLESCHEME') 
 ALTER TABLE T_CAS_RECPAYRULE_E ADD (FHANDLESCHEME NVARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_RECPAYRULE' AND KSQL_COL_NAME ='FCTRLSTRATEGY') 
 ALTER TABLE T_CAS_RECPAYRULE ADD (FCTRLSTRATEGY NVARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_EXCHANGEBILL' AND KSQL_COL_NAME ='FIMAGENUMBER') 
 ALTER TABLE T_CAS_EXCHANGEBILL ADD (FIMAGENUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_RECEIVINGBILL_E' AND KSQL_COL_NAME ='FIMAGENUMBER') 
 ALTER TABLE T_CAS_RECEIVINGBILL_E ADD (FIMAGENUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_AGENTPAYBILL_E' AND KSQL_COL_NAME ='FIMAGENUMBER') 
 ALTER TABLE T_CAS_AGENTPAYBILL_E ADD (FIMAGENUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_PAYMENTBILL_E' AND KSQL_COL_NAME ='FISWAITSCHE') 
 ALTER TABLE T_CAS_PAYMENTBILL_E ADD (FISWAITSCHE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_PAYMENTBILL_E' AND KSQL_COL_NAME ='FIMAGENUMBER') 
 ALTER TABLE T_CAS_PAYMENTBILL_E ADD (FIMAGENUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL );

/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\CAS_table.sql **/
