/**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_STRUCTOFCHANGETYPE' AND KSQL_COL_NAME ='FISEXCHANGE') 
 ALTER TABLE T_BCM_STRUCTOFCHANGETYPE ADD (FISEXCHANGE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_RPTADJUST' AND KSQL_COL_NAME ='FISMULTIPLECURRENCY') 
 ALTER TABLE T_BCM_RPTADJUST ADD (FISMULTIPLECURRENCY CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_STRUCTOFACCOUNT_S' AND KSQL_COL_NAME ='FENTRYRATE') 
 ALTER TABLE T_BCM_STRUCTOFACCOUNT_S ADD (FENTRYRATE VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_RPTADJUSTDATA' AND KSQL_COL_NAME ='FISDEFAULTCURRENCY') 
 ALTER TABLE T_BCM_RPTADJUSTDATA ADD (FISDEFAULTCURRENCY CHAR(1) DEFAULT '1' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_RPTADJUSTDATA' AND KSQL_COL_NAME ='FENTRYROWTYPE') 
 ALTER TABLE T_BCM_RPTADJUSTDATA ADD (FENTRYROWTYPE CHAR(1) DEFAULT '1' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_ISBIZRULE') 
 CREATE TABLE T_BCM_ISBIZRULE (
FID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FBIZRULEID BIGINT DEFAULT 0 NOT NULL
);


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