/**Begin D:\PDM_UPGRADE\PDM1\CAS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_UNCOMPANYDETAIL' AND KSQL_COL_NAME IN ('FBANKDETAILNO'))
 ALTER TABLE T_CAS_UNCOMPANYDETAIL ADD (FBANKDETAILNO NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_UNCOMPANYDETAIL' AND KSQL_COL_NAME IN ('FOPPUNIT'))
 ALTER TABLE T_CAS_UNCOMPANYDETAIL ADD (FOPPUNIT NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_UNCOMPANYDETAIL' AND KSQL_COL_NAME IN ('FOPPACCOUNTNUMBER'))
 ALTER TABLE T_CAS_UNCOMPANYDETAIL ADD (FOPPACCOUNTNUMBER NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_UNCOMPANYDETAIL' AND KSQL_COL_NAME IN ('FOPPBANK'))
 ALTER TABLE T_CAS_UNCOMPANYDETAIL ADD (FOPPBANK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_UNBANKDETAIL' AND KSQL_COL_NAME IN ('FOPPUNIT'))
 ALTER TABLE T_CAS_UNBANKDETAIL ADD (FOPPUNIT NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_UNBANKDETAIL' AND KSQL_COL_NAME IN ('FOPPACCTNUMBER'))
 ALTER TABLE T_CAS_UNBANKDETAIL ADD (FOPPACCTNUMBER NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_UNBANKDETAIL' AND KSQL_COL_NAME IN ('FOPPBANK'))
 ALTER TABLE T_CAS_UNBANKDETAIL ADD (FOPPBANK NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_CHECKEDRESULTENTRY' AND KSQL_COL_NAME IN ('FBANKDETAILNO'))
 ALTER TABLE T_CAS_CHECKEDRESULTENTRY ADD (FBANKDETAILNO NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_BANKSTATEMENT' AND KSQL_COL_NAME IN ('FBANKDETAILNO'))
 ALTER TABLE T_CAS_BANKSTATEMENT ADD (FBANKDETAILNO NVARCHAR(255) DEFAULT ' ' NOT NULL );

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