/**Begin D:\PDM_UPGRADE\PDM1\BCM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_MEMBERLIST' AND KSQL_COL_NAME IN ('FMEMBSCOPE')) 
 ALTER TABLE T_BCM_MEMBERLIST ADD (FMEMBSCOPE INT DEFAULT 10000 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_DYNAMICLIST' AND KSQL_COL_NAME IN ('FBASEID')) 
 ALTER TABLE T_BCM_DYNAMICLIST ADD (FBASEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_DYNAMICLIST' AND KSQL_COL_NAME IN ('FFORMULA')) 
 ALTER TABLE T_BCM_DYNAMICLIST ADD (FFORMULA VARCHAR(1000) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_DYNAMICLIST' AND KSQL_COL_NAME IN ('FFORMULA_TAG')) 
 ALTER TABLE T_BCM_DYNAMICLIST ADD (FFORMULA_TAG NCLOB );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_DOCUMENT' AND KSQL_COL_NAME IN ('FCREATORID')) 
 ALTER TABLE T_BCM_DOCUMENT ADD (FCREATORID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_DOCUMENT' AND KSQL_COL_NAME IN ('FMODIFIERID')) 
 ALTER TABLE T_BCM_DOCUMENT ADD (FMODIFIERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_DOCUMENT' AND KSQL_COL_NAME IN ('FCREATETIME')) 
 ALTER TABLE T_BCM_DOCUMENT ADD (FCREATETIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_DOCUMENT' AND KSQL_COL_NAME IN ('FMODIFYTIME')) 
 ALTER TABLE T_BCM_DOCUMENT ADD (FMODIFYTIME DATETIME );

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