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

