/**Begin D:\PDM\PDM_UPGRADE\pdm1\BCM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_STAGESTATUS' AND KSQL_COL_NAME ='FMODELID') 
 ALTER TABLE T_BCM_STAGESTATUS ADD (FMODELID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_STAGESTATUS' AND KSQL_COL_NAME ='FSCENARIOID') 
 ALTER TABLE T_BCM_STAGESTATUS ADD (FSCENARIOID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_STAGESTATUS' AND KSQL_COL_NAME ='FYEARID') 
 ALTER TABLE T_BCM_STAGESTATUS ADD (FYEARID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_STAGESTATUS' AND KSQL_COL_NAME ='FPERIODID') 
 ALTER TABLE T_BCM_STAGESTATUS ADD (FPERIODID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_STAGESTATUS' AND KSQL_COL_NAME ='FORGNUMBER') 
 ALTER TABLE T_BCM_STAGESTATUS ADD (FORGNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_PHASESUBMIT' AND KSQL_COL_NAME ='FISDEFAULT') 
 ALTER TABLE T_BCM_PHASESUBMIT ADD (FISDEFAULT CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_PHASESUBMIT' AND KSQL_COL_NAME ='FISUSESTART') 
 ALTER TABLE T_BCM_PHASESUBMIT ADD (FISUSESTART CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_RPTADJUSTDATA' AND KSQL_COL_NAME ='FMERGEID') 
 ALTER TABLE T_BCM_RPTADJUSTDATA ADD (FMERGEID BIGINT DEFAULT 0 NOT NULL );
 EXEC p_AlterColumn 'T_BCM_FLOWSTEP', 'FINTERSEQ', 'CHAR(1)', 'NOT NULL', '0001', ''' ''';


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