/**Begin D:\d_desk\pdm\PDM_UPGRADE_1.1\PDM_UPGRADE\pdm1\BDM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_bdm_issue_policy_log' AND KSQL_COL_NAME ='forg')
 ALTER TABLE t_bdm_issue_policy_log ADD (forg BIGINT DEFAULT 0 NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_bdm_issue_policy_log' AND KSQL_COL_NAME ='finvoicecode')
 ALTER TABLE t_bdm_issue_policy_log ADD (finvoicecode VARCHAR(50) DEFAULT '0' NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_bdm_issue_policy_log' AND KSQL_COL_NAME ='finvoiceno')
 ALTER TABLE t_bdm_issue_policy_log ADD (finvoiceno VARCHAR(50) DEFAULT '0' NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_bdm_issue_policy_log' AND KSQL_COL_NAME ='fissuestatus')
 ALTER TABLE t_bdm_issue_policy_log ADD (fissuestatus VARCHAR(10) DEFAULT '0' NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_bdm_issue_policy_log' AND KSQL_COL_NAME ='fbillno')
 ALTER TABLE t_bdm_issue_policy_log ADD (fbillno VARCHAR(100) DEFAULT '0' NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_bdm_issue_policy_log' AND KSQL_COL_NAME ='fepname')
 ALTER TABLE t_bdm_issue_policy_log ADD (fepname VARCHAR(100) DEFAULT '0' NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_bdm_issue_policy_log' AND KSQL_COL_NAME ='ftaxno')
 ALTER TABLE t_bdm_issue_policy_log ADD (ftaxno VARCHAR(100) DEFAULT '0' NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_bdm_issue_policy_log' AND KSQL_COL_NAME ='fusemonth')
 ALTER TABLE t_bdm_issue_policy_log ADD (fusemonth VARCHAR(100) DEFAULT '0' NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_bdm_issue_policy_log' AND KSQL_COL_NAME ='fissuetime')
 ALTER TABLE t_bdm_issue_policy_log ADD (fissuetime datetime );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 't_bdm_issue_policy_log' AND KSQL_COL_NAME ='finvoiceamount')
 ALTER TABLE t_bdm_issue_policy_log ADD (finvoiceamount decimal(23,10) default 0 not null );

/**End D:\d_desk\pdm\PDM_UPGRADE_1.1\PDM_UPGRADE\pdm1\BDM_table.sql **/
