/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BCM_table.sql **/
/** EXEC p_AlterColumn 'T_BCM_ANALYSISCHARTACOPE', 'FPARENT', 'BIGINT', 'NOT NULL', '0010', '0';**/

/**  EXEC p_AlterColumn 'T_BCM_ANALYSISCHARTACOPE', 'FMEMNUMBER', 'VARCHAR(50)', 'NOT NULL', '0010', ''' ''';**/

/**  EXEC p_AlterColumn 'T_BCM_ANALYSISCHARTACOPE', 'FDIMENSION', 'BIGINT', 'NOT NULL', '0010', '0';**/

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_REPORT' AND KSQL_COL_NAME ='FVERSIONID') 
 ALTER TABLE T_BCM_REPORT ADD (FVERSIONID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_REPORTLIST' AND KSQL_COL_NAME ='FVERSIONID') 
 ALTER TABLE T_BCM_REPORTLIST ADD (FVERSIONID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CSLSCHEME' AND KSQL_COL_NAME ='FEFFECTIVEDATE') 
 ALTER TABLE T_BCM_CSLSCHEME ADD (FEFFECTIVEDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CSLSCHEME' AND KSQL_COL_NAME ='FEXPIRATIONDATE') 
 ALTER TABLE T_BCM_CSLSCHEME ADD (FEXPIRATIONDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CSLSCHEME' AND KSQL_COL_NAME ='FEFFECTIVESTATUS') 
 ALTER TABLE T_BCM_CSLSCHEME ADD (FEFFECTIVESTATUS CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CSLSCHEME' AND KSQL_COL_NAME ='FVERSION') 
 ALTER TABLE T_BCM_CSLSCHEME ADD (FVERSION INT DEFAULT 1 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_CSLSCHEME' AND KSQL_COL_NAME ='FISLEGALORGVIEW') 
 ALTER TABLE T_BCM_CSLSCHEME ADD (FISLEGALORGVIEW CHAR(1) DEFAULT '0' NOT NULL );

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