/**Begin D:\PDM_UPGRADE\PDM1\CAS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_CASHMGTINITBANK' AND KSQL_COL_NAME IN ('FJOURNALSUMBALANCEADJ')) 
 ALTER TABLE T_CAS_CASHMGTINITBANK ADD (FJOURNALSUMBALANCEADJ DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_ACCOUNTBALANCE' AND KSQL_COL_NAME IN ('FOPENORGID')) 
 ALTER TABLE T_CAS_ACCOUNTBALANCE ADD (FOPENORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_JOURNALBALANCE' AND KSQL_COL_NAME IN ('FOPENORGID')) 
 ALTER TABLE T_CAS_JOURNALBALANCE ADD (FOPENORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_UNBANKDETAIL' AND KSQL_COL_NAME IN ('FORGID')) 
 ALTER TABLE T_CAS_UNBANKDETAIL ADD (FORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_BANKJOURNAL' AND KSQL_COL_NAME IN ('FOPENORGID')) 
 ALTER TABLE T_CAS_BANKJOURNAL ADD (FOPENORGID BIGINT DEFAULT 0 NOT NULL );