/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BCM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_BASECVTFORMULA' AND KSQL_COL_NAME ='FCONVERTMODEL') 
 ALTER TABLE T_BCM_BASECVTFORMULA ADD (FCONVERTMODEL CHAR(1) DEFAULT '1' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_BASECVTFORMULA' AND KSQL_COL_NAME ='FCONVERTAUDITTRIALID') 
 ALTER TABLE T_BCM_BASECVTFORMULA ADD (FCONVERTAUDITTRIALID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_BASECVTFORMULA' AND KSQL_COL_NAME ='FCVTDIFFAUDITTRIALID') 
 ALTER TABLE T_BCM_BASECVTFORMULA ADD (FCVTDIFFAUDITTRIALID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_RPTADJUSTDATA' AND KSQL_COL_NAME ='FLINKSOURCE') 
 ALTER TABLE T_BCM_RPTADJUSTDATA ADD (FLINKSOURCE BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_RPTADJUSTDATA' AND KSQL_COL_NAME ='FISCHANGED') 
 ALTER TABLE T_BCM_RPTADJUSTDATA ADD (FISCHANGED CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_LINKAGEENTRY' AND KSQL_COL_NAME ='FAUDITTRAILID') 
 ALTER TABLE T_BCM_LINKAGEENTRY ADD (FAUDITTRAILID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_LINKAGEENTRY' AND KSQL_COL_NAME ='FAUDITTRAILRANGE') 
 ALTER TABLE T_BCM_LINKAGEENTRY ADD (FAUDITTRAILRANGE INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_DSADJUSTDATA' AND KSQL_COL_NAME ='FDEBITUNIT') 
 ALTER TABLE T_BCM_DSADJUSTDATA ADD (FDEBITUNIT CHAR(1) DEFAULT '1' NOT NULL );

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