/**Begin D:\softwaresetup\PDM_UPGRADE\PDM1\CAS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_EXCHANGEBILL' AND KSQL_COL_NAME IN ('FBUYPREAMOUNT'))
 ALTER TABLE T_CAS_EXCHANGEBILL ADD (FBUYPREAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_EXCHANGEBILL' AND KSQL_COL_NAME IN ('FBUYISPREFLAG'))
 ALTER TABLE T_CAS_EXCHANGEBILL ADD (FBUYISPREFLAG CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_EXCHANGEBILL' AND KSQL_COL_NAME IN ('FSELLPREAMOUNT'))
 ALTER TABLE T_CAS_EXCHANGEBILL ADD (FSELLPREAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_EXCHANGEBILL' AND KSQL_COL_NAME IN ('FSELLISPREFLAG'))
 ALTER TABLE T_CAS_EXCHANGEBILL ADD (FSELLISPREFLAG CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_EXCHANGEBILL' AND KSQL_COL_NAME IN ('FFEEPREAMOUNT'))
 ALTER TABLE T_CAS_EXCHANGEBILL ADD (FFEEPREAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_EXCHANGEBILL' AND KSQL_COL_NAME IN ('FFEEISPREFLAG'))
 ALTER TABLE T_CAS_EXCHANGEBILL ADD (FFEEISPREFLAG CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_RECEIVINGBILL_E' AND KSQL_COL_NAME IN ('FPREAMOUNTPAY'))
 ALTER TABLE T_CAS_RECEIVINGBILL_E ADD (FPREAMOUNTPAY DECIMAL(19,6) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_RECEIVINGBILL_E' AND KSQL_COL_NAME IN ('FISPREFLAG'))
 ALTER TABLE T_CAS_RECEIVINGBILL_E ADD (FISPREFLAG CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_RECEIVINGBILL_E' AND KSQL_COL_NAME IN ('FPREAMOUNTREC'))
 ALTER TABLE T_CAS_RECEIVINGBILL_E ADD (FPREAMOUNTREC DECIMAL(19,6) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_PAYMENTBILL_E' AND KSQL_COL_NAME IN ('FPREAMOUNTPAY'))
 ALTER TABLE T_CAS_PAYMENTBILL_E ADD (FPREAMOUNTPAY DECIMAL(19,6) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_PAYMENTBILL_E' AND KSQL_COL_NAME IN ('FISPREFLAG'))
 ALTER TABLE T_CAS_PAYMENTBILL_E ADD (FISPREFLAG 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 IN ('FPREAMOUNTREC'))
 ALTER TABLE T_CAS_PAYMENTBILL_E ADD (FPREAMOUNTREC DECIMAL(19,6) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_AGENTPAYBILLENTRY_E' AND KSQL_COL_NAME IN ('FENTRYPREAMOUNT'))
 ALTER TABLE T_CAS_AGENTPAYBILLENTRY_E ADD (FENTRYPREAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_AGENTPAYBILLENTRY_E' AND KSQL_COL_NAME IN ('FENTRYISPREFLAG'))
 ALTER TABLE T_CAS_AGENTPAYBILLENTRY_E ADD (FENTRYISPREFLAG CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_AGENTPAYBILL_E' AND KSQL_COL_NAME IN ('FPREAMOUNT'))
 ALTER TABLE T_CAS_AGENTPAYBILL_E ADD (FPREAMOUNT DECIMAL(19,6) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_AGENTPAYBILL_E' AND KSQL_COL_NAME IN ('FISPREFLAG'))
 ALTER TABLE T_CAS_AGENTPAYBILL_E ADD (FISPREFLAG CHAR(1) DEFAULT '0' NOT NULL );

/**End D:\softwaresetup\PDM_UPGRADE\PDM1\CAS_table.sql **/

