/**Begin D:\PDM_UPGRADE\PDM1\HOM_table.sql **/

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_ONBRD_BCHG_P')
 CREATE TABLE T_HOM_ONBRD_BCHG_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_HOM_ONBRD_BCHG_E')
 CREATE TABLE T_HOM_ONBRD_BCHG_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_HOM_ONBRD_BCHG_D')
 CREATE TABLE T_HOM_ONBRD_BCHG_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,
FJOBID 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,
FBSED DATETIME,
FBSLED DATETIME,
FCMPEMPID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSYSENDDATE DATETIME
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HOM_ONBRD_ACHG_E')
 CREATE TABLE T_HOM_ONBRD_ACHG_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_HOM_ONBRD_ACHG_D')
 CREATE TABLE T_HOM_ONBRD_ACHG_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,
FEMPGROUPID BIGINT DEFAULT 0 NOT NULL,
FAFFILIATEADMINORGID 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,
FBSED DATETIME,
FBSLED DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSYSENDDATE DATETIME
);




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