/**Begin D:\PDM_UPGRADE\PDM1\HDM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HDM_REG_BEFORECHG_P') 
 CREATE TABLE T_HDM_REG_BEFORECHG_P (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FPERSONID BIGINT DEFAULT 0 NOT NULL,
FCHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HDM_REG_AFTERCHG_P') 
 CREATE TABLE T_HDM_REG_AFTERCHG_P (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FPERSONID BIGINT DEFAULT 0 NOT NULL,
FCHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HDM_REG_BEFORECHG_E') 
 CREATE TABLE T_HDM_REG_BEFORECHG_E (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FEMPLOYEEID BIGINT DEFAULT 0 NOT NULL,
FCHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL,
FENTERPRISEID BIGINT DEFAULT 0 NOT NULL,
FLABORRELTYPEID BIGINT DEFAULT 0 NOT NULL,
FLABORRELSTATUSID BIGINT DEFAULT 0 NOT NULL,
FEMPNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FSTARTDATE DATETIME,
FENDDATE DATETIME,
FBSED DATETIME,
FBSLED DATETIME,
FSYSENDDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HDM_REG_AFTERCHG_E') 
 CREATE TABLE T_HDM_REG_AFTERCHG_E (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FCHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL,
FEMPLOYEEID BIGINT DEFAULT 0 NOT NULL,
FENTERPRISEID BIGINT DEFAULT 0 NOT NULL,
FLABORRELTYPEID BIGINT DEFAULT 0 NOT NULL,
FLABORRELSTATUSID BIGINT DEFAULT 0 NOT NULL,
FEMPNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FSTARTDATE DATETIME,
FENDDATE DATETIME,
FBSED DATETIME,
FBSLED DATETIME,
FSYSENDDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HDM_REG_AFTERCHG_D') 
 CREATE TABLE T_HDM_REG_AFTERCHG_D (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FCHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL,
FDEPEMPID BIGINT DEFAULT 0 NOT NULL,
FADMINORGID BIGINT DEFAULT 0 NOT NULL,
FPOSITIONID BIGINT DEFAULT 0 NOT NULL,
FJOBID BIGINT DEFAULT 0 NOT NULL,
FSTDPOSITIONID BIGINT DEFAULT 0 NOT NULL,
FPOSTYPEID BIGINT DEFAULT 0 NOT NULL,
FSTARTDATE DATETIME,
FENDDATE DATETIME,
FBSED DATETIME,
FBSLED DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FEMPGROUPID BIGINT DEFAULT 0 NOT NULL,
FAFFILIATEADMINORGID BIGINT DEFAULT 0 NOT NULL,
FPOSSTATUSID BIGINT DEFAULT 0 NOT NULL,
FBUSINESSSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FCMPEMPID BIGINT DEFAULT 0 NOT NULL,
FERFILEID BIGINT DEFAULT 0 NOT NULL,
FORGNUMBERVID BIGINT DEFAULT 0 NOT NULL,
FSYSENDDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HDM_REG_BEFORECHG_D') 
 CREATE TABLE T_HDM_REG_BEFORECHG_D (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FCHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL,
FDEPEMPID BIGINT DEFAULT 0 NOT NULL,
FADMINORGID BIGINT DEFAULT 0 NOT NULL,
FPOSITIONID BIGINT DEFAULT 0 NOT NULL,
FJOBID BIGINT DEFAULT 0 NOT NULL,
FSTDPOSITIONID BIGINT DEFAULT 0 NOT NULL,
FPOSTYPEID BIGINT DEFAULT 0 NOT NULL,
FPOSSTATUSID BIGINT DEFAULT 0 NOT NULL,
FSTARTDATE DATETIME,
FENDDATE DATETIME,
FBSED DATETIME,
FBSLED DATETIME,
FBUSINESSSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FEMPGROUPID BIGINT DEFAULT 0 NOT NULL,
FAFFILIATEADMINORGID BIGINT DEFAULT 0 NOT NULL,
FORGNUMBERVID BIGINT DEFAULT 0 NOT NULL,
FCMPEMPID BIGINT DEFAULT 0 NOT NULL,
FSYSENDDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HDM_BEFORETRANSFER_P') 
 CREATE TABLE T_HDM_BEFORETRANSFER_P (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FPERSONID BIGINT DEFAULT 0 NOT NULL,
FCHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HDM_AFTERTRANSFER_P') 
 CREATE TABLE T_HDM_AFTERTRANSFER_P (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FPERSONID BIGINT DEFAULT 0 NOT NULL,
FCHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HDM_AFTERTRANSFER_E') 
 CREATE TABLE T_HDM_AFTERTRANSFER_E (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FCHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL,
FEMPLOYEEID BIGINT DEFAULT 0 NOT NULL,
FENTERPRISEID BIGINT DEFAULT 0 NOT NULL,
FLABORRELTYPEID BIGINT DEFAULT 0 NOT NULL,
FLABORRELSTATUSID BIGINT DEFAULT 0 NOT NULL,
FEMPNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FSTARTDATE DATETIME,
FENDDATE DATETIME,
FBSED DATETIME,
FBSLED DATETIME,
FSYSENDDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HDM_BEFORETRANSFER_E') 
 CREATE TABLE T_HDM_BEFORETRANSFER_E (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FEMPLOYEEID BIGINT DEFAULT 0 NOT NULL,
FCHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL,
FENTERPRISEID BIGINT DEFAULT 0 NOT NULL,
FLABORRELTYPEID BIGINT DEFAULT 0 NOT NULL,
FLABORRELSTATUSID BIGINT DEFAULT 0 NOT NULL,
FEMPNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FSTARTDATE DATETIME,
FENDDATE DATETIME,
FBSED DATETIME,
FBSLED DATETIME,
FSYSENDDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HDM_AFTERTRANSFER_D') 
 CREATE TABLE T_HDM_AFTERTRANSFER_D (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FCHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL,
FDEPEMPID BIGINT DEFAULT 0 NOT NULL,
FADMINORGID BIGINT DEFAULT 0 NOT NULL,
FPOSITIONID BIGINT DEFAULT 0 NOT NULL,
FJOBID BIGINT DEFAULT 0 NOT NULL,
FSTDPOSITIONID BIGINT DEFAULT 0 NOT NULL,
FPOSTYPEID BIGINT DEFAULT 0 NOT NULL,
FSTARTDATE DATETIME,
FENDDATE DATETIME,
FBSED DATETIME,
FBSLED DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FEMPGROUPID BIGINT DEFAULT 0 NOT NULL,
FAFFILIATEADMINORGID BIGINT DEFAULT 0 NOT NULL,
FPOSSTATUSID BIGINT DEFAULT 0 NOT NULL,
FBUSINESSSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FCMPEMPID BIGINT DEFAULT 0 NOT NULL,
FERFILEID BIGINT DEFAULT 0 NOT NULL,
FORGNUMBERVID BIGINT DEFAULT 0 NOT NULL,
FAPOSITIONTYPE VARCHAR(2) DEFAULT ' ' NOT NULL,
FISPRIMARY VARCHAR(2) DEFAULT ' ' NOT NULL,
FSYSENDDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HDM_BEFORETRANSFER_D') 
 CREATE TABLE T_HDM_BEFORETRANSFER_D (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FCHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL,
FDEPEMPID BIGINT DEFAULT 0 NOT NULL,
FADMINORGID BIGINT DEFAULT 0 NOT NULL,
FPOSITIONID BIGINT DEFAULT 0 NOT NULL,
FSTDPOSITIONID BIGINT DEFAULT 0 NOT NULL,
FPOSTYPEID BIGINT DEFAULT 0 NOT NULL,
FSTARTDATE DATETIME,
FENDDATE DATETIME,
FBSED DATETIME,
FBSLED DATETIME,
FJOBID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FAFFILIATEADMINORGID BIGINT DEFAULT 0 NOT NULL,
FEMPGROUPID BIGINT DEFAULT 0 NOT NULL,
FPOSSTATUSID BIGINT DEFAULT 0 NOT NULL,
FBUSINESSSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FORGNUMBERVID BIGINT DEFAULT 0 NOT NULL,
FCMPEMPID BIGINT DEFAULT 0 NOT NULL,
FSYSENDDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HDM_PART_BEFORECHG_P') 
 CREATE TABLE T_HDM_PART_BEFORECHG_P (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FPERSONID BIGINT DEFAULT 0 NOT NULL,
FCHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HDM_PART_AFTERCHG_P') 
 CREATE TABLE T_HDM_PART_AFTERCHG_P (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FPERSONID BIGINT DEFAULT 0 NOT NULL,
FCHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HDM_PART_BEFORECHG_E') 
 CREATE TABLE T_HDM_PART_BEFORECHG_E (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FEMPLOYEEID BIGINT DEFAULT 0 NOT NULL,
FCHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL,
FENTERPRISEID BIGINT DEFAULT 0 NOT NULL,
FLABORRELTYPEID BIGINT DEFAULT 0 NOT NULL,
FLABORRELSTATUSID BIGINT DEFAULT 0 NOT NULL,
FEMPNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FSTARTDATE DATETIME,
FENDDATE DATETIME,
FBSED DATETIME,
FBSLED DATETIME,
FSYSENDDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HDM_PART_AFTERCHG_E') 
 CREATE TABLE T_HDM_PART_AFTERCHG_E (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FCHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL,
FEMPLOYEEID BIGINT DEFAULT 0 NOT NULL,
FENTERPRISEID BIGINT DEFAULT 0 NOT NULL,
FLABORRELTYPEID BIGINT DEFAULT 0 NOT NULL,
FLABORRELSTATUSID BIGINT DEFAULT 0 NOT NULL,
FEMPNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FSTARTDATE DATETIME,
FENDDATE DATETIME,
FBSED DATETIME,
FBSLED DATETIME,
FSYSENDDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HDM_PART_AFTERCHG_D') 
 CREATE TABLE T_HDM_PART_AFTERCHG_D (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FCHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL,
FDEPEMPID BIGINT DEFAULT 0 NOT NULL,
FADMINORGID BIGINT DEFAULT 0 NOT NULL,
FPOSITIONID BIGINT DEFAULT 0 NOT NULL,
FJOBID BIGINT DEFAULT 0 NOT NULL,
FSTDPOSITIONID BIGINT DEFAULT 0 NOT NULL,
FPOSTYPEID BIGINT DEFAULT 0 NOT NULL,
FSTARTDATE DATETIME,
FENDDATE DATETIME,
FBSED DATETIME,
FBSLED DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FEMPGROUPID BIGINT DEFAULT 0 NOT NULL,
FAFFILIATEADMINORGID BIGINT DEFAULT 0 NOT NULL,
FPOSSTATUSID BIGINT DEFAULT 0 NOT NULL,
FBUSINESSSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FCMPEMPID BIGINT DEFAULT 0 NOT NULL,
FERFILEID BIGINT DEFAULT 0 NOT NULL,
FORGNUMBERVID BIGINT DEFAULT 0 NOT NULL,
FSYSENDDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HDM_PART_BEFORECHG_D') 
 CREATE TABLE T_HDM_PART_BEFORECHG_D (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FCHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL,
FDEPEMPID BIGINT DEFAULT 0 NOT NULL,
FADMINORGID BIGINT DEFAULT 0 NOT NULL,
FPOSITIONID BIGINT DEFAULT 0 NOT NULL,
FJOBID BIGINT DEFAULT 0 NOT NULL,
FSTDPOSITIONID BIGINT DEFAULT 0 NOT NULL,
FPOSTYPEID BIGINT DEFAULT 0 NOT NULL,
FPOSSTATUSID BIGINT DEFAULT 0 NOT NULL,
FSTARTDATE DATETIME,
FENDDATE DATETIME,
FBSED DATETIME,
FBSLED DATETIME,
FBUSINESSSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FEMPGROUPID BIGINT DEFAULT 0 NOT NULL,
FAFFILIATEADMINORGID BIGINT DEFAULT 0 NOT NULL,
FORGNUMBERVID BIGINT DEFAULT 0 NOT NULL,
FCMPEMPID BIGINT DEFAULT 0 NOT NULL,
FSYSENDDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HDM_PARTEND_BEFORECHG_P') 
 CREATE TABLE T_HDM_PARTEND_BEFORECHG_P (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FPERSONID BIGINT DEFAULT 0 NOT NULL,
FCHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HDM_PARTEND_AFTERCHG_P') 
 CREATE TABLE T_HDM_PARTEND_AFTERCHG_P (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FPERSONID BIGINT DEFAULT 0 NOT NULL,
FCHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HDM_PARTEND_BEFORECHG_E') 
 CREATE TABLE T_HDM_PARTEND_BEFORECHG_E (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FEMPLOYEEID BIGINT DEFAULT 0 NOT NULL,
FCHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL,
FENTERPRISEID BIGINT DEFAULT 0 NOT NULL,
FLABORRELTYPEID BIGINT DEFAULT 0 NOT NULL,
FLABORRELSTATUSID BIGINT DEFAULT 0 NOT NULL,
FEMPNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FSTARTDATE DATETIME,
FENDDATE DATETIME,
FBSED DATETIME,
FBSLED DATETIME,
FSYSENDDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HDM_PARTEND_AFTERCHG_E') 
 CREATE TABLE T_HDM_PARTEND_AFTERCHG_E (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FCHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL,
FEMPLOYEEID BIGINT DEFAULT 0 NOT NULL,
FENTERPRISEID BIGINT DEFAULT 0 NOT NULL,
FLABORRELTYPEID BIGINT DEFAULT 0 NOT NULL,
FLABORRELSTATUSID BIGINT DEFAULT 0 NOT NULL,
FEMPNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FSTARTDATE DATETIME,
FENDDATE DATETIME,
FBSED DATETIME,
FBSLED DATETIME,
FSYSENDDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HDM_PARTEND_AFTERCHG_D') 
 CREATE TABLE T_HDM_PARTEND_AFTERCHG_D (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FCHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL,
FDEPEMPID BIGINT DEFAULT 0 NOT NULL,
FADMINORGID BIGINT DEFAULT 0 NOT NULL,
FPOSITIONID BIGINT DEFAULT 0 NOT NULL,
FJOBID BIGINT DEFAULT 0 NOT NULL,
FSTDPOSITIONID BIGINT DEFAULT 0 NOT NULL,
FPOSTYPEID BIGINT DEFAULT 0 NOT NULL,
FSTARTDATE DATETIME,
FENDDATE DATETIME,
FBSED DATETIME,
FBSLED DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FEMPGROUPID BIGINT DEFAULT 0 NOT NULL,
FAFFILIATEADMINORGID BIGINT DEFAULT 0 NOT NULL,
FPOSSTATUSID BIGINT DEFAULT 0 NOT NULL,
FBUSINESSSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FCMPEMPID BIGINT DEFAULT 0 NOT NULL,
FERFILEID BIGINT DEFAULT 0 NOT NULL,
FORGNUMBERVID BIGINT DEFAULT 0 NOT NULL,
FSYSENDDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HDM_PARTEND_BEFORECHG_D') 
 CREATE TABLE T_HDM_PARTEND_BEFORECHG_D (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FCHGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL,
FDEPEMPID BIGINT DEFAULT 0 NOT NULL,
FADMINORGID BIGINT DEFAULT 0 NOT NULL,
FPOSITIONID BIGINT DEFAULT 0 NOT NULL,
FJOBID BIGINT DEFAULT 0 NOT NULL,
FSTDPOSITIONID BIGINT DEFAULT 0 NOT NULL,
FPOSTYPEID BIGINT DEFAULT 0 NOT NULL,
FPOSSTATUSID BIGINT DEFAULT 0 NOT NULL,
FSTARTDATE DATETIME,
FENDDATE DATETIME,
FBSED DATETIME,
FBSLED DATETIME,
FBUSINESSSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FEMPGROUPID BIGINT DEFAULT 0 NOT NULL,
FAFFILIATEADMINORGID BIGINT DEFAULT 0 NOT NULL,
FORGNUMBERVID BIGINT DEFAULT 0 NOT NULL,
FCMPEMPID BIGINT DEFAULT 0 NOT NULL,
FSYSENDDATE DATETIME
);



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