/**Begin D:\PDM_UPGRADE\PDM1\HAOS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HAOS_STAFFPROJECT') 
 CREATE TABLE T_HAOS_STAFFPROJECT (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FUNITYSTAFFDIMENSION CHAR(1) DEFAULT ' ' NOT NULL,
FCONTROLSTRATEGY VARCHAR(2) DEFAULT ' ' NOT NULL,
FUNITYCONTROLMODE CHAR(1) DEFAULT ' ' NOT NULL,
FELASTICCONTROL VARCHAR(2) DEFAULT ' ' NOT NULL,
FELASTICCOUNT INT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FSTATUS VARCHAR(2) DEFAULT 'C' NOT NULL,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HAOS_STAFFPROJECT_L') 
 CREATE TABLE T_HAOS_STAFFPROJECT_L (
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HAOS_STAFFDIMENSION') 
 CREATE TABLE T_HAOS_STAFFDIMENSION (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FISSMALLDIMENSION CHAR(1) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FSTATUS VARCHAR(2) DEFAULT 'C' NOT NULL,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HAOS_STAFFDIMENSION_L') 
 CREATE TABLE T_HAOS_STAFFDIMENSION_L (
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HAOS_STAFF') 
 CREATE TABLE T_HAOS_STAFF (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FYEAR DATETIME,
FSTAFFPROJECTID BIGINT DEFAULT 0 NOT NULL,
FSTAFFCYCLEID BIGINT DEFAULT 0 NOT NULL,
FCONTROLSTRATEGY VARCHAR(2) DEFAULT ' ' NOT NULL,
FELASTICCONTROL VARCHAR(2) DEFAULT ' ' NOT NULL,
FELASTICCOUNT INT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FSTATUS VARCHAR(2) DEFAULT 'C' NOT NULL,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HAOS_STAFF_L') 
 CREATE TABLE T_HAOS_STAFF_L (
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HAOS_DUTYORGDETAIL') 
 CREATE TABLE T_HAOS_DUTYORGDETAIL (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FVID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FDUTYORGID BIGINT DEFAULT 0 NOT NULL,
FSTAFFCOUNT INT DEFAULT 0 NOT NULL,
FDISTRIBUTABLE INT DEFAULT 0 NOT NULL,
FCONTROLSTRATEGY VARCHAR(2) DEFAULT ' ' NOT NULL,
FELASTICCONTROL VARCHAR(2) DEFAULT ' ' NOT NULL,
FELASTICCOUNT INT DEFAULT 0 NOT NULL,
FLEFFDT DATETIME,
FEFFDT DATETIME,
FDATASTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FSEQ INT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HAOS_DOSDIMENSION') 
 CREATE TABLE T_HAOS_DOSDIMENSION (
FPKID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HAOS_USEORGDETAIL') 
 CREATE TABLE T_HAOS_USEORGDETAIL (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FVID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FUSEORGID BIGINT DEFAULT 0 NOT NULL,
FDUTYORGID BIGINT DEFAULT 0 NOT NULL,
FCONTROLSTRATEGY VARCHAR(2) DEFAULT ' ' NOT NULL,
FELASTICCONTROL VARCHAR(2) DEFAULT ' ' NOT NULL,
FELASTICCOUNT INT DEFAULT 0 NOT NULL,
FLEFFDT DATETIME,
FEFFDT DATETIME,
FDATASTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FYEARSTAFF INT DEFAULT 0 NOT NULL,
FHALFYEARSTAFF1 INT DEFAULT 0 NOT NULL,
FHALFYEARSTAFF2 INT DEFAULT 0 NOT NULL,
FQUARTERSTAFF1 INT DEFAULT 0 NOT NULL,
FQUARTERSTAFF2 INT DEFAULT 0 NOT NULL,
FQUARTERSTAFF3 INT DEFAULT 0 NOT NULL,
FQUARTERSTAFF4 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF1 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF2 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF3 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF4 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF5 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF6 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF7 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF8 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF9 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF10 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF11 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF12 INT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FSEQ INT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HAOS_UOSDIMENSION') 
 CREATE TABLE T_HAOS_UOSDIMENSION (
FPKID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HAOS_MULDIMENDETAIL') 
 CREATE TABLE T_HAOS_MULDIMENDETAIL (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FVID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FUSEORGID BIGINT DEFAULT 0 NOT NULL,
FCONTROLSTRATEGY VARCHAR(2) DEFAULT ' ' NOT NULL,
FELASTICCONTROL VARCHAR(2) DEFAULT ' ' NOT NULL,
FELASTICCOUNT INT DEFAULT 0 NOT NULL,
FORGTEAMID BIGINT DEFAULT 0 NOT NULL,
FDUTYWORKROLEID BIGINT DEFAULT 0 NOT NULL,
FJOBID BIGINT DEFAULT 0 NOT NULL,
FJOBLEVELID BIGINT DEFAULT 0 NOT NULL,
FBASICDATA1 BIGINT DEFAULT 0 NOT NULL,
FBASICDATA2 BIGINT DEFAULT 0 NOT NULL,
FLEFFDT DATETIME,
FEFFDT DATETIME,
FDATASTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FSEQ INT DEFAULT 0 NOT NULL,
FYEARSTAFF INT DEFAULT 0 NOT NULL,
FHALFYEARSTAFF1 INT DEFAULT 0 NOT NULL,
FHALFYEARSTAFF2 INT DEFAULT 0 NOT NULL,
FQUARTERSTAFF1 INT DEFAULT 0 NOT NULL,
FQUARTERSTAFF2 INT DEFAULT 0 NOT NULL,
FQUARTERSTAFF3 INT DEFAULT 0 NOT NULL,
FQUARTERSTAFF4 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF1 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF2 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF3 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF4 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF5 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF6 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF7 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF8 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF9 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF10 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF11 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF12 INT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HAOS_STAFFCYCLE') 
 CREATE TABLE T_HAOS_STAFFCYCLE (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FCYCLETYPE VARCHAR(2) DEFAULT ' ' NOT NULL,
FSTARTDATE VARCHAR(2) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FSTATUS VARCHAR(2) DEFAULT 'C' NOT NULL,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HAOS_STAFFCYCLE_L') 
 CREATE TABLE T_HAOS_STAFFCYCLE_L (
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HAOS_DUTYORGDETAILHIS') 
 CREATE TABLE T_HAOS_DUTYORGDETAILHIS (
FVID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FDUTYORGID BIGINT DEFAULT 0 NOT NULL,
FSTAFFCOUNT INT DEFAULT 0 NOT NULL,
FDISTRIBUTABLE INT DEFAULT 0 NOT NULL,
FCONTROLSTRATEGY VARCHAR(2) DEFAULT ' ' NOT NULL,
FELASTICCONTROL VARCHAR(2) DEFAULT ' ' NOT NULL,
FELASTICCOUNT INT DEFAULT 0 NOT NULL,
FLEFFDT DATETIME,
FEFFDT DATETIME,
FDATASTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FSEQ INT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HAOS_DOSDIMENSIONHIS') 
 CREATE TABLE T_HAOS_DOSDIMENSIONHIS (
FPKID BIGINT DEFAULT 0 NOT NULL,
FVID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HAOS_USEORGDETAILHIS') 
 CREATE TABLE T_HAOS_USEORGDETAILHIS (
FVID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FUSEORGID BIGINT DEFAULT 0 NOT NULL,
FDUTYORGID BIGINT DEFAULT 0 NOT NULL,
FCONTROLSTRATEGY VARCHAR(2) DEFAULT ' ' NOT NULL,
FELASTICCONTROL VARCHAR(2) DEFAULT ' ' NOT NULL,
FELASTICCOUNT INT DEFAULT 0 NOT NULL,
FYEARSTAFF INT DEFAULT 0 NOT NULL,
FHALFYEARSTAFF1 INT DEFAULT 0 NOT NULL,
FHALFYEARSTAFF2 INT DEFAULT 0 NOT NULL,
FQUARTERSTAFF1 INT DEFAULT 0 NOT NULL,
FQUARTERSTAFF2 INT DEFAULT 0 NOT NULL,
FQUARTERSTAFF3 INT DEFAULT 0 NOT NULL,
FQUARTERSTAFF4 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF1 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF2 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF3 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF4 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF5 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF6 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF7 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF8 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF9 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF10 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF11 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF12 INT DEFAULT 0 NOT NULL,
FLEFFDT DATETIME,
FEFFDT DATETIME,
FDATASTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FSEQ INT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HAOS_UOSDIMENSIONHIS') 
 CREATE TABLE T_HAOS_UOSDIMENSIONHIS (
FPKID BIGINT DEFAULT 0 NOT NULL,
FVID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HAOS_MULDIMENDETAILHIS') 
 CREATE TABLE T_HAOS_MULDIMENDETAILHIS (
FVID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FUSEORGID BIGINT DEFAULT 0 NOT NULL,
FCONTROLSTRATEGY VARCHAR(2) DEFAULT ' ' NOT NULL,
FELASTICCONTROL VARCHAR(2) DEFAULT ' ' NOT NULL,
FELASTICCOUNT INT DEFAULT 0 NOT NULL,
FORGTEAMID BIGINT DEFAULT 0 NOT NULL,
FDUTYWORKROLEID BIGINT DEFAULT 0 NOT NULL,
FJOBID BIGINT DEFAULT 0 NOT NULL,
FJOBLEVELID BIGINT DEFAULT 0 NOT NULL,
FBASICDATA1 BIGINT DEFAULT 0 NOT NULL,
FBASICDATA2 BIGINT DEFAULT 0 NOT NULL,
FLEFFDT DATETIME,
FEFFDT DATETIME,
FDATASTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FSEQ INT DEFAULT 0 NOT NULL,
FYEARSTAFF INT DEFAULT 0 NOT NULL,
FHALFYEARSTAFF1 INT DEFAULT 0 NOT NULL,
FHALFYEARSTAFF2 INT DEFAULT 0 NOT NULL,
FQUARTERSTAFF1 INT DEFAULT 0 NOT NULL,
FQUARTERSTAFF2 INT DEFAULT 0 NOT NULL,
FQUARTERSTAFF3 INT DEFAULT 0 NOT NULL,
FQUARTERSTAFF4 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF1 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF2 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF3 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF4 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF5 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF6 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF7 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF8 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF9 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF10 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF11 INT DEFAULT 0 NOT NULL,
FMONTHSTAFF12 INT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HAOS_SPORGENTRY') 
 CREATE TABLE T_HAOS_SPORGENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FADMINORGID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FISCONTAINSLOWER CHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HAOS_SPDIMENSION') 
 CREATE TABLE T_HAOS_SPDIMENSION (
FPKID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HAOS_STAFFMULDIMENSION') 
 CREATE TABLE T_HAOS_STAFFMULDIMENSION (
FPKID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);



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