/**Begin D:\PDM_UPGRADE\PDM1\CAS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_RECEIVINGBILL_E' AND KSQL_COL_NAME IN ('FMATCHFLAG'))
ALTER TABLE T_CAS_RECEIVINGBILL_E ADD (FMATCHFLAG NVARCHAR(5) 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 ('FMATCHAMOUNTPAY'))
ALTER TABLE T_CAS_RECEIVINGBILL_E ADD (FMATCHAMOUNTPAY 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 ('FUNMATCHAMOUNTPAY'))
ALTER TABLE T_CAS_RECEIVINGBILL_E ADD (FUNMATCHAMOUNTPAY 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 ('FMATCHAMOUNTREC'))
ALTER TABLE T_CAS_RECEIVINGBILL_E ADD (FMATCHAMOUNTREC 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 ('FUNMATCHAMOUNTREC'))
ALTER TABLE T_CAS_RECEIVINGBILL_E ADD (FUNMATCHAMOUNTREC 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 ('FMATCHFLAGMSG'))
ALTER TABLE T_CAS_RECEIVINGBILL_E ADD (FMATCHFLAGMSG 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 IN ('FRELATEOTHERFLOW'))
ALTER TABLE T_CAS_RECEIVINGBILL_E ADD (FRELATEOTHERFLOW 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 ('FMATCHFLAG'))
ALTER TABLE T_CAS_PAYMENTBILL_E ADD (FMATCHFLAG NVARCHAR(5) 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 ('FMATCHAMOUNTPAY'))
ALTER TABLE T_CAS_PAYMENTBILL_E ADD (FMATCHAMOUNTPAY 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 ('FUNMATCHAMOUNTPAY'))
ALTER TABLE T_CAS_PAYMENTBILL_E ADD (FUNMATCHAMOUNTPAY 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 ('FMATCHAMOUNTREC'))
ALTER TABLE T_CAS_PAYMENTBILL_E ADD (FMATCHAMOUNTREC 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 ('FUNMATCHAMOUNTREC'))
ALTER TABLE T_CAS_PAYMENTBILL_E ADD (FUNMATCHAMOUNTREC 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 ('FMATCHFLAGMSG'))
ALTER TABLE T_CAS_PAYMENTBILL_E ADD (FMATCHFLAGMSG 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 IN ('FRELATEOTHERFLOW'))
ALTER TABLE T_CAS_PAYMENTBILL_E ADD (FRELATEOTHERFLOW CHAR(1) DEFAULT '0' NOT NULL );

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