IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_WRITEOFFAPPLY' AND KSQL_COL_NAME ='FEXPENSEITEMFIELD')
ALTER TABLE T_ER_WRITEOFFAPPLY ADD (FEXPENSEITEMFIELD BIGINT DEFAULT 0 NOT NULL);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_WRITEOFFAPPLY' AND KSQL_COL_NAME ='FDATEFIELD')
ALTER TABLE T_ER_WRITEOFFAPPLY ADD (FDATEFIELD DATETIME);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_WRITEOFFAPPLY' AND KSQL_COL_NAME ='FORGFIELD')
ALTER TABLE T_ER_WRITEOFFAPPLY ADD (FORGFIELD BIGINT DEFAULT 0 NOT NULL);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBREIMWRIOFFAPPLY' AND KSQL_COL_NAME ='FEXPENSEITEMFIELD')
ALTER TABLE T_ER_PUBREIMWRIOFFAPPLY ADD (FEXPENSEITEMFIELD BIGINT DEFAULT 0 NOT NULL);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBREIMWRIOFFAPPLY' AND KSQL_COL_NAME ='FDATEFIELD')
ALTER TABLE T_ER_PUBREIMWRIOFFAPPLY ADD (FDATEFIELD DATETIME);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_ER_PUBREIMWRIOFFAPPLY' AND KSQL_COL_NAME ='FORGFIELD')
ALTER TABLE T_ER_PUBREIMWRIOFFAPPLY ADD (FORGFIELD BIGINT DEFAULT 0 NOT NULL);



