/**Begin D:\PDM_UPGRADE\PDM1\CAS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_BALANCEMODEL_CASH' AND KSQL_COL_NAME IN ('FYEARSTART'))
 ALTER TABLE T_CAS_BALANCEMODEL_CASH ADD (FYEARSTART DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_BALANCEMODEL_CASH' AND KSQL_COL_NAME IN ('FYEARBALANCE'))
 ALTER TABLE T_CAS_BALANCEMODEL_CASH ADD (FYEARBALANCE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_BALANCEMODEL_CASH' AND KSQL_COL_NAME IN ('FYEARPAYAMOUNT'))
 ALTER TABLE T_CAS_BALANCEMODEL_CASH ADD (FYEARPAYAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_BALANCEMODEL_CASH' AND KSQL_COL_NAME IN ('FYEARRECAMOUNT'))
 ALTER TABLE T_CAS_BALANCEMODEL_CASH ADD (FYEARRECAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_BALANCEMODEL_JOURNA' AND KSQL_COL_NAME IN ('FYEARSTART'))
 ALTER TABLE T_CAS_BALANCEMODEL_JOURNA ADD (FYEARSTART DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_BALANCEMODEL_JOURNA' AND KSQL_COL_NAME IN ('FYEARBALANCE'))
 ALTER TABLE T_CAS_BALANCEMODEL_JOURNA ADD (FYEARBALANCE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_BALANCEMODEL_JOURNA' AND KSQL_COL_NAME IN ('FYEARPAYAMOUNT'))
 ALTER TABLE T_CAS_BALANCEMODEL_JOURNA ADD (FYEARPAYAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_BALANCEMODEL_JOURNA' AND KSQL_COL_NAME IN ('FYEARRECAMOUNT'))
 ALTER TABLE T_CAS_BALANCEMODEL_JOURNA ADD (FYEARRECAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_BALANCEMODEL_STATE' AND KSQL_COL_NAME IN ('FYEARSTART'))
 ALTER TABLE T_CAS_BALANCEMODEL_STATE ADD (FYEARSTART DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_BALANCEMODEL_STATE' AND KSQL_COL_NAME IN ('FYEARBALANCE'))
 ALTER TABLE T_CAS_BALANCEMODEL_STATE ADD (FYEARBALANCE DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_BALANCEMODEL_STATE' AND KSQL_COL_NAME IN ('FYEARPAYAMOUNT'))
 ALTER TABLE T_CAS_BALANCEMODEL_STATE ADD (FYEARPAYAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_BALANCEMODEL_STATE' AND KSQL_COL_NAME IN ('FYEARRECAMOUNT'))
 ALTER TABLE T_CAS_BALANCEMODEL_STATE ADD (FYEARRECAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL );


 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_BALANCELOG_INIT' AND KSQL_COL_NAME IN ('FYEARDEBIT'))
  ALTER TABLE T_CAS_BALANCELOG_INIT ADD (FYEARDEBIT DECIMAL(23,10) DEFAULT 0 NOT NULL );
   IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_BALANCELOG_INIT' AND KSQL_COL_NAME IN ('FYEARCREDIT'))
    ALTER TABLE T_CAS_BALANCELOG_INIT ADD (FYEARCREDIT DECIMAL(23,10) DEFAULT 0 NOT NULL );

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