/**Begin D:\PDM_UPGRADE\PDM1\HDM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGBASEBILL_C' AND KSQL_COL_NAME IN ('FBA_D_MTID')) 
 ALTER TABLE T_HDM_REGBASEBILL_C ADD (FBA_D_MTID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGBASEBILL_C' AND KSQL_COL_NAME IN ('FB_EFFECTIVEDATE')) 
 ALTER TABLE T_HDM_REGBASEBILL_C ADD (FB_EFFECTIVEDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGBASEBILL_C' AND KSQL_COL_NAME IN ('FBB_P_CHGTYPE')) 
 ALTER TABLE T_HDM_REGBASEBILL_C ADD (FBB_P_CHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGBASEBILL_C' AND KSQL_COL_NAME IN ('FBA_P_CHGTYPE')) 
 ALTER TABLE T_HDM_REGBASEBILL_C ADD (FBA_P_CHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGBASEBILL_C' AND KSQL_COL_NAME IN ('FBB_E_CHGTYPE')) 
 ALTER TABLE T_HDM_REGBASEBILL_C ADD (FBB_E_CHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGBASEBILL_C' AND KSQL_COL_NAME IN ('FBA_E_CHGTYPE')) 
 ALTER TABLE T_HDM_REGBASEBILL_C ADD (FBA_E_CHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGBASEBILL_C' AND KSQL_COL_NAME IN ('FBB_D_CHGTYPE')) 
 ALTER TABLE T_HDM_REGBASEBILL_C ADD (FBB_D_CHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGBASEBILL_C' AND KSQL_COL_NAME IN ('FBA_D_CHGTYPE')) 
 ALTER TABLE T_HDM_REGBASEBILL_C ADD (FBA_D_CHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGBASEBILL_C' AND KSQL_COL_NAME IN ('FBA_D_BUSINESSSTATUS')) 
 ALTER TABLE T_HDM_REGBASEBILL_C ADD (FBA_D_BUSINESSSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGBASEBILL_C' AND KSQL_COL_NAME IN ('FBEFORELABORRELTYPEID')) 
 ALTER TABLE T_HDM_REGBASEBILL_C ADD (FBEFORELABORRELTYPEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGBASEBILL_C' AND KSQL_COL_NAME IN ('FBB_E_EMPNUMBER')) 
 ALTER TABLE T_HDM_REGBASEBILL_C ADD (FBB_E_EMPNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGBASEBILL_C' AND KSQL_COL_NAME IN ('FBB_E_ENTERPRISEID')) 
 ALTER TABLE T_HDM_REGBASEBILL_C ADD (FBB_E_ENTERPRISEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_REGBASEBILL_C' AND KSQL_COL_NAME IN ('FBB_E_STARTDATE')) 
 ALTER TABLE T_HDM_REGBASEBILL_C ADD (FBB_E_STARTDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEAPPLYBILL_C' AND KSQL_COL_NAME IN ('FBA_D_MTID')) 
 ALTER TABLE T_HDM_PARTTIMEAPPLYBILL_C ADD (FBA_D_MTID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEAPPLYBILL_C' AND KSQL_COL_NAME IN ('FB_EFFECTIVEDATE')) 
 ALTER TABLE T_HDM_PARTTIMEAPPLYBILL_C ADD (FB_EFFECTIVEDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEAPPLYBILL_C' AND KSQL_COL_NAME IN ('FBB_P_CHGTYPE')) 
 ALTER TABLE T_HDM_PARTTIMEAPPLYBILL_C ADD (FBB_P_CHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEAPPLYBILL_C' AND KSQL_COL_NAME IN ('FBA_P_CHGTYPE')) 
 ALTER TABLE T_HDM_PARTTIMEAPPLYBILL_C ADD (FBA_P_CHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEAPPLYBILL_C' AND KSQL_COL_NAME IN ('FBB_E_CHGTYPE')) 
 ALTER TABLE T_HDM_PARTTIMEAPPLYBILL_C ADD (FBB_E_CHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEAPPLYBILL_C' AND KSQL_COL_NAME IN ('FBA_E_CHGTYPE')) 
 ALTER TABLE T_HDM_PARTTIMEAPPLYBILL_C ADD (FBA_E_CHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEAPPLYBILL_C' AND KSQL_COL_NAME IN ('FBB_D_CHGTYPE')) 
 ALTER TABLE T_HDM_PARTTIMEAPPLYBILL_C ADD (FBB_D_CHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEAPPLYBILL_C' AND KSQL_COL_NAME IN ('FBA_D_CHGTYPE')) 
 ALTER TABLE T_HDM_PARTTIMEAPPLYBILL_C ADD (FBA_D_CHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEAPPLYBILL_C' AND KSQL_COL_NAME IN ('FBA_D_BUSINESSSTATUS')) 
 ALTER TABLE T_HDM_PARTTIMEAPPLYBILL_C ADD (FBA_D_BUSINESSSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEAPPLYBILL_C' AND KSQL_COL_NAME IN ('FBEFORELABORRELTYPEID')) 
 ALTER TABLE T_HDM_PARTTIMEAPPLYBILL_C ADD (FBEFORELABORRELTYPEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEENDBILL_C' AND KSQL_COL_NAME IN ('FBA_D_MTID')) 
 ALTER TABLE T_HDM_PARTTIMEENDBILL_C ADD (FBA_D_MTID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEENDBILL_C' AND KSQL_COL_NAME IN ('FB_EFFECTIVEDATE')) 
 ALTER TABLE T_HDM_PARTTIMEENDBILL_C ADD (FB_EFFECTIVEDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEENDBILL_C' AND KSQL_COL_NAME IN ('FBB_P_CHGTYPE')) 
 ALTER TABLE T_HDM_PARTTIMEENDBILL_C ADD (FBB_P_CHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEENDBILL_C' AND KSQL_COL_NAME IN ('FBA_P_CHGTYPE')) 
 ALTER TABLE T_HDM_PARTTIMEENDBILL_C ADD (FBA_P_CHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEENDBILL_C' AND KSQL_COL_NAME IN ('FBB_E_CHGTYPE')) 
 ALTER TABLE T_HDM_PARTTIMEENDBILL_C ADD (FBB_E_CHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEENDBILL_C' AND KSQL_COL_NAME IN ('FBA_E_CHGTYPE')) 
 ALTER TABLE T_HDM_PARTTIMEENDBILL_C ADD (FBA_E_CHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEENDBILL_C' AND KSQL_COL_NAME IN ('FBB_D_CHGTYPE')) 
 ALTER TABLE T_HDM_PARTTIMEENDBILL_C ADD (FBB_D_CHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEENDBILL_C' AND KSQL_COL_NAME IN ('FBA_D_CHGTYPE')) 
 ALTER TABLE T_HDM_PARTTIMEENDBILL_C ADD (FBA_D_CHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEENDBILL_C' AND KSQL_COL_NAME IN ('FBA_D_BUSINESSSTATUS')) 
 ALTER TABLE T_HDM_PARTTIMEENDBILL_C ADD (FBA_D_BUSINESSSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEENDBILL_C' AND KSQL_COL_NAME IN ('FBEFORELABORRELTYPEID')) 
 ALTER TABLE T_HDM_PARTTIMEENDBILL_C ADD (FBEFORELABORRELTYPEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_TRANSFERBILL_C' AND KSQL_COL_NAME IN ('FBA_D_MTID')) 
 ALTER TABLE T_HDM_TRANSFERBILL_C ADD (FBA_D_MTID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_TRANSFERBILL_C' AND KSQL_COL_NAME IN ('FB_EFFECTIVEDATE')) 
 ALTER TABLE T_HDM_TRANSFERBILL_C ADD (FB_EFFECTIVEDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_TRANSFERBILL_C' AND KSQL_COL_NAME IN ('FBB_P_CHGTYPE')) 
 ALTER TABLE T_HDM_TRANSFERBILL_C ADD (FBB_P_CHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_TRANSFERBILL_C' AND KSQL_COL_NAME IN ('FBA_P_CHGTYPE')) 
 ALTER TABLE T_HDM_TRANSFERBILL_C ADD (FBA_P_CHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_TRANSFERBILL_C' AND KSQL_COL_NAME IN ('FBB_E_CHGTYPE')) 
 ALTER TABLE T_HDM_TRANSFERBILL_C ADD (FBB_E_CHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_TRANSFERBILL_C' AND KSQL_COL_NAME IN ('FBA_E_CHGTYPE')) 
 ALTER TABLE T_HDM_TRANSFERBILL_C ADD (FBA_E_CHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_TRANSFERBILL_C' AND KSQL_COL_NAME IN ('FBB_D_CHGTYPE')) 
 ALTER TABLE T_HDM_TRANSFERBILL_C ADD (FBB_D_CHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_TRANSFERBILL_C' AND KSQL_COL_NAME IN ('FBA_D_CHGTYPE')) 
 ALTER TABLE T_HDM_TRANSFERBILL_C ADD (FBA_D_CHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_TRANSFERBILL_C' AND KSQL_COL_NAME IN ('FBA_D_BUSINESSSTATUS')) 
 ALTER TABLE T_HDM_TRANSFERBILL_C ADD (FBA_D_BUSINESSSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_TRANSFERBILL_C' AND KSQL_COL_NAME IN ('FBEFOREPOSTYPEID')) 
 ALTER TABLE T_HDM_TRANSFERBILL_C ADD (FBEFOREPOSTYPEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_TRANSFERBILL_C' AND KSQL_COL_NAME IN ('FBB_D_BUSINESSSTATUS')) 
 ALTER TABLE T_HDM_TRANSFERBILL_C ADD (FBB_D_BUSINESSSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_TRANSFERBILL_C' AND KSQL_COL_NAME IN ('FBB_D_STARTDATE')) 
 ALTER TABLE T_HDM_TRANSFERBILL_C ADD (FBB_D_STARTDATE DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_TRANSFERBILL_C' AND KSQL_COL_NAME IN ('FBEFORELABORRELTYPEID')) 
 ALTER TABLE T_HDM_TRANSFERBILL_C ADD (FBEFORELABORRELTYPEID BIGINT DEFAULT 0 NOT NULL );

/**End D:\PDM_UPGRADE\PDM1\HDM_table.sql **/
