/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BCM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_ISEVENTLOG') 
 CREATE TABLE T_BCM_ISEVENTLOG (
FID BIGINT DEFAULT 0 NOT NULL,
FTRACECODE VARCHAR(20) DEFAULT ' ' NOT NULL,
FSOURCE VARCHAR(30) DEFAULT ' ' NOT NULL,
FNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FDETAILS NCLOB,
FRESULT CHAR(1) DEFAULT '0' NOT NULL,
FSTARTTIME DATETIME,
FENDTIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_ISGROUPSRCMAPENTRY' AND KSQL_COL_NAME ='FSRCMEMBNUMBER') 
 ALTER TABLE T_BCM_ISGROUPSRCMAPENTRY ADD (FSRCMEMBNUMBER VARCHAR(200) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_ISGROUPTARGMAPENTRY' AND KSQL_COL_NAME ='FTARMEMNUMBER') 
 ALTER TABLE T_BCM_ISGROUPTARGMAPENTRY ADD (FTARMEMNUMBER VARCHAR(200) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_STRUCTOFENT' AND KSQL_COL_NAME ='FISINDEPENDENTORG') 
 ALTER TABLE T_BCM_STRUCTOFENT ADD (FISINDEPENDENTORG CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_ISSINGLEMAP' AND KSQL_COL_NAME ='FSCHEMEID') 
 ALTER TABLE T_BCM_ISSINGLEMAP ADD (FSCHEMEID BIGINT DEFAULT 0 NOT NULL );

/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BCM_table.sql **/
