IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_INVRELATION' AND KSQL_COL_NAME ='FISCONFIRMED') 
 ALTER TABLE T_BCM_INVRELATION ADD (FISCONFIRMED CHAR(1) DEFAULT '0' NOT NULL );
 
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_INVRELATION_TEMP') 
 CREATE TABLE T_BCM_INVRELATION_TEMP (
FPKID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);



IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_OFFSETCTRLCONF') 
 CREATE TABLE T_BCM_OFFSETCTRLCONF (
FID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FSCENARIOID BIGINT DEFAULT 0 NOT NULL,
FYEARID BIGINT DEFAULT 0 NOT NULL,
FPERIODID BIGINT DEFAULT 0 NOT NULL,
FINVCONTROL CHAR(1) DEFAULT '1' NOT NULL,
FCHECKCONTROL CHAR(1) DEFAULT '1' NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYDATE DATETIME
);