/**Begin D:\DBA\PDM_UPGRADE\PDM1\BCM_table.sql **/
 EXEC p_AlterColumn 'T_BCM_EPM', 'FREMARK', 'NCLOB', 'NULL', '1111', 'NULL';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_EPM' AND KSQL_COL_NAME IN ('FSTATUS')) 
 ALTER TABLE T_BCM_EPM ADD (FSTATUS CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_EPM' AND KSQL_COL_NAME IN ('FCREATER')) 
 ALTER TABLE T_BCM_EPM ADD (FCREATER BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_EPM' AND KSQL_COL_NAME IN ('FCREATEDATE')) 
 ALTER TABLE T_BCM_EPM ADD (FCREATEDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_EPM' AND KSQL_COL_NAME IN ('FMODIFIER')) 
 ALTER TABLE T_BCM_EPM ADD (FMODIFIER BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_EPM' AND KSQL_COL_NAME IN ('FMODIFYDATE')) 
 ALTER TABLE T_BCM_EPM ADD (FMODIFYDATE DATETIME );
 EXEC p_AlterColumn 'T_BCM_EPM_L', 'FREMARK', 'NCLOB', 'NULL', '1111', 'NULL';

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



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