/**Begin D:\DBA\PDM_UPGRADE\PDM1\BCM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_MERGECONTROL') 
 CREATE TABLE T_BCM_MERGECONTROL (
FID 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,
FORGNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FCURRENCYNUMBER VARCHAR(10) DEFAULT ' ' NOT NULL,
FCALCULATESTATUS VARCHAR(10) DEFAULT ' ' NOT NULL,
FFLOWSTATUS VARCHAR(10) DEFAULT ' ' NOT NULL,
FARCHIVESTATUS VARCHAR(10) DEFAULT ' ' NOT NULL,
FPROGRESSID BIGINT DEFAULT 0 NOT NULL,
FFLOWTASKID BIGINT DEFAULT 0 NOT NULL,
FBEGINTIME DATETIME,
FENDTIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_FLOWTASK') 
 CREATE TABLE T_BCM_FLOWTASK (
FID BIGINT DEFAULT 0 NOT NULL,
FBIZID BIGINT DEFAULT 0 NOT NULL,
FSTEPID BIGINT DEFAULT 0 NOT NULL,
FLASTSTEPID BIGINT DEFAULT 0 NOT NULL,
FLASTTASKID BIGINT DEFAULT 0 NOT NULL,
FACTION CHAR(1) DEFAULT ' ' NOT NULL,
FACTORID BIGINT DEFAULT 0 NOT NULL,
FFINISHTIME DATETIME,
FOPINION VARCHAR(1000) DEFAULT ' ' NOT NULL,
FTRACEID VARCHAR(20) DEFAULT ' ' NOT NULL
);



/**End D:\DBA\PDM_UPGRADE\PDM1\BCM_table.sql **/
