/**Begin D:\PDM\PDM_UPGRADE\pdm1\BCM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_MDDATA' AND KSQL_COL_NAME ='FSSID') 
 ALTER TABLE T_BCM_MDDATA ADD (FSSID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_MDDATA' AND KSQL_COL_NAME ='SOID') 
 ALTER TABLE T_BCM_MDDATA ADD (SOID VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_DATACOMPARISONTABLE') 
 CREATE TABLE T_BCM_DATACOMPARISONTABLE (
FID BIGINT DEFAULT 0 NOT NULL,
FAMOUNT DECIMAL(23,15) DEFAULT 0 NOT NULL,
FENTITY VARCHAR(100) DEFAULT ' ' NOT NULL,
FFY VARCHAR(100) DEFAULT ' ' NOT NULL,
FPERIOD VARCHAR(100) DEFAULT ' ' NOT NULL,
FSCENARIO VARCHAR(100) DEFAULT ' ' NOT NULL,
FMULTIGAAP VARCHAR(100) DEFAULT ' ' NOT NULL,
FCURRENCY VARCHAR(100) DEFAULT ' ' NOT NULL,
FACCOUNT VARCHAR(100) DEFAULT ' ' NOT NULL,
FCHANGETYPE VARCHAR(100) DEFAULT ' ' NOT NULL,
FAUDITTRAIL VARCHAR(100) DEFAULT ' ' NOT NULL,
FPROCESS VARCHAR(100) DEFAULT ' ' NOT NULL,
FDATASORT VARCHAR(100) DEFAULT ' ' NOT NULL,
FINTERNALCOMPANY VARCHAR(100) DEFAULT ' ' NOT NULL,
FMYCOMPANY VARCHAR(100) DEFAULT ' ' NOT NULL,
FDIM1 VARCHAR(100) DEFAULT ' ' NOT NULL,
FDIM2 VARCHAR(100) DEFAULT ' ' NOT NULL,
FDIM3 VARCHAR(100) DEFAULT ' ' NOT NULL,
FDIM4 VARCHAR(100) DEFAULT ' ' NOT NULL,
FDIM5 VARCHAR(100) DEFAULT ' ' NOT NULL,
FDIM6 VARCHAR(100) DEFAULT ' ' NOT NULL,
FMDAMOUNT DECIMAL(23,15) DEFAULT 0 NOT NULL,
FMDENTITY VARCHAR(100) DEFAULT ' ' NOT NULL,
FMDFY VARCHAR(100) DEFAULT ' ' NOT NULL,
FMDPERIOD VARCHAR(100) DEFAULT ' ' NOT NULL,
FMDSCENARIO VARCHAR(100) DEFAULT ' ' NOT NULL,
FMDMULTIGAAP VARCHAR(100) DEFAULT ' ' NOT NULL,
FMDCURRENCY VARCHAR(100) DEFAULT ' ' NOT NULL,
FMDACCOUNT VARCHAR(100) DEFAULT ' ' NOT NULL,
FMDCHANGETYPE VARCHAR(100) DEFAULT ' ' NOT NULL,
FMDAUDITTRAIL VARCHAR(100) DEFAULT ' ' NOT NULL,
FMDPROCESS VARCHAR(100) DEFAULT ' ' NOT NULL,
FMDDATASORT VARCHAR(100) DEFAULT ' ' NOT NULL,
FMDINTERNALCOMPANY VARCHAR(100) DEFAULT ' ' NOT NULL,
FMDMYCOMPANY VARCHAR(100) DEFAULT ' ' NOT NULL,
FMDDIM1 VARCHAR(100) DEFAULT ' ' NOT NULL,
FMDDIM2 VARCHAR(100) DEFAULT ' ' NOT NULL,
FMDDIM3 VARCHAR(100) DEFAULT ' ' NOT NULL,
FMDDIM4 VARCHAR(100) DEFAULT ' ' NOT NULL,
FMDDIM5 VARCHAR(100) DEFAULT ' ' NOT NULL,
FMDDIM6 VARCHAR(100) DEFAULT ' ' NOT NULL,
FSCHEME BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_DSADJUSTDATA') 
 CREATE TABLE T_BCM_DSADJUSTDATA (
FID BIGINT DEFAULT 0 NOT NULL,
FAMOUNT DECIMAL(23,15) DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(100) DEFAULT ' ' NOT NULL,
FNAME VARCHAR(200) DEFAULT ' ' NOT NULL,
FDESCRIPTION VARCHAR(100) DEFAULT ' ' NOT NULL,
FENTRYDESCRIPTION VARCHAR(100) DEFAULT ' ' NOT NULL,
FENTITY VARCHAR(100) DEFAULT ' ' NOT NULL,
FFY VARCHAR(100) DEFAULT ' ' NOT NULL,
FPERIOD VARCHAR(100) DEFAULT ' ' NOT NULL,
FSCENARIO VARCHAR(100) DEFAULT ' ' NOT NULL,
FMULTIGAAP VARCHAR(100) DEFAULT ' ' NOT NULL,
FCURRENCY VARCHAR(100) DEFAULT ' ' NOT NULL,
FACCOUNT VARCHAR(100) DEFAULT ' ' NOT NULL,
FCHANGETYPE VARCHAR(100) DEFAULT ' ' NOT NULL,
FAUDITTRAIL VARCHAR(100) DEFAULT ' ' NOT NULL,
FPROCESS VARCHAR(100) DEFAULT ' ' NOT NULL,
FDATASORT VARCHAR(100) DEFAULT ' ' NOT NULL,
FINTERNALCOMPANY VARCHAR(100) DEFAULT ' ' NOT NULL,
FMYCOMPANY VARCHAR(100) DEFAULT ' ' NOT NULL,
FDIM1 VARCHAR(100) DEFAULT ' ' NOT NULL,
FDIM2 VARCHAR(100) DEFAULT ' ' NOT NULL,
FDIM3 VARCHAR(100) DEFAULT ' ' NOT NULL,
FDIM4 VARCHAR(100) DEFAULT ' ' NOT NULL,
FDIM5 VARCHAR(100) DEFAULT ' ' NOT NULL,
FDIM6 VARCHAR(100) DEFAULT ' ' NOT NULL,
FSSID BIGINT DEFAULT 0 NOT NULL,
FSOID VARCHAR(50) DEFAULT ' ' NOT NULL,
FBELONGORG VARCHAR(100) DEFAULT ' ' NOT NULL,
FBALANCEDTYPE CHAR(1) DEFAULT ' ' NOT NULL
);



/**End D:\PDM\PDM_UPGRADE\pdm1\BCM_table.sql **/
