/**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_BIZRULE' AND KSQL_COL_NAME ='FDEBUG') 
 ALTER TABLE T_BCM_BIZRULE ADD (FDEBUG NCLOB );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_BIZRULE' AND KSQL_COL_NAME ='FRUNSTATUS') 
 ALTER TABLE T_BCM_BIZRULE ADD (FRUNSTATUS CHAR(1) DEFAULT ' ' NOT NULL );
 
 EXEC p_AlterColumn 'T_BCM_BIZRULE', 'FRUNSTATUS', 'CHAR(1)', 'NOT NULL', '0001', '''1''';
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_BIZRULEVERSION' AND KSQL_COL_NAME ='FDEBUG') 
 ALTER TABLE T_BCM_BIZRULEVERSION ADD (FDEBUG NCLOB );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_BIZRULEVERSION' AND KSQL_COL_NAME ='FRUNSTATUS') 
 ALTER TABLE T_BCM_BIZRULEVERSION ADD (FRUNSTATUS CHAR(1) DEFAULT '1' NOT NULL );