/**Begin D:\tools\PDM_UPGRADE\PDM1\HIES_table.sql **/
--T_HIES_DIAETPLCONF
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HIES_ENTRYTPLCONF')
 CREATE TABLE T_HIES_ENTRYTPLCONF (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(2) DEFAULT 'C' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FTMPLTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FENTITYID VARCHAR(50) DEFAULT ' ' NOT NULL,
FORGFIELD BIGINT DEFAULT 0 NOT NULL,
FINSTRUCTION NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FALLOCATIONPOLICY VARCHAR(2) DEFAULT ' ' NOT NULL,
FAPPLYSCOPE VARCHAR(20) DEFAULT ' ' NOT NULL,
FTPLSCOPE VARCHAR(20) DEFAULT ' ' NOT NULL,
FCUSTOMPAGE VARCHAR(50) DEFAULT ' ' NOT NULL,
FIMPORTTYPE VARCHAR(20) DEFAULT ' ' NOT NULL,
FENABLEDOWNCOND VARCHAR(2) DEFAULT ' ' NOT NULL,
FMAINENTITYUNIQUEVAL VARCHAR(500) DEFAULT ' ' NOT NULL,
FPLUGIN VARCHAR(2000) DEFAULT ' ' NOT NULL,
FFIELDMERGE VARCHAR(2000) DEFAULT ' ' NOT NULL,
FFIELDSTYLE NCLOB DEFAULT ' ',
FMETAVERSION VARCHAR(2000) DEFAULT ' ' NOT NULL,
FSOURCE VARCHAR(20) DEFAULT ' ' NOT NULL,
FENTRYTYPE VARCHAR(255) DEFAULT ' ' NOT NULL
);

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

--T_HIES_DIAETPLFIELDCONF
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HIES_ENTRYTPLFIELDCONF')
 CREATE TABLE T_HIES_ENTRYTPLFIELDCONF (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FPARENTENTRYID BIGINT DEFAULT 0 NOT NULL,
FCHILDENTITYID VARCHAR(50) DEFAULT ' ' NOT NULL,
FFIELDNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FENTITYDESCRIPTION NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FISIMPORT CHAR(1) DEFAULT '0' NOT NULL,
FISMUSTINPUT CHAR(1) DEFAULT '0' NOT NULL,
FISDOWNLOADCOND CHAR(1) DEFAULT '0' NOT NULL,
FISCONDGETDATA CHAR(1) DEFAULT '0' NOT NULL,
FFIELDIMPORTDESC NVARCHAR(255) DEFAULT ' ' NOT NULL,
FISFIELD CHAR(1) DEFAULT '0' NOT NULL,
FIMPTATTR VARCHAR(20) DEFAULT ' ' NOT NULL,
FEXPTATTR VARCHAR(500) DEFAULT ' ' NOT NULL,
FISSHEET VARCHAR(1) DEFAULT ' ' NOT NULL,
FDEFVALPROP VARCHAR(2000) DEFAULT ' ' NOT NULL,
FISCUSFIELD CHAR(1) DEFAULT ' ' NOT NULL,
FISCHECKED CHAR(1) DEFAULT ' ' NOT NULL,
FFIELDNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCUSFIELDID BIGINT DEFAULT 0 NOT NULL
);

--T_HIES_DIAETPLFIELDCONF_L
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HIES_ENTRYTPLFIELDCONF_L')
 CREATE TABLE T_HIES_ENTRYTPLFIELDCONF_L (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FENTITYDESCRIPTION NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FFIELDIMPORTDESC NVARCHAR(255) DEFAULT ' ' NOT NULL,
FFIELDNAME NVARCHAR(255) DEFAULT ' ' NOT NULL
);

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

--T_HIES_DIAETPLROLE
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HIES_ENTRYTPLROLE')
 CREATE TABLE T_HIES_ENTRYTPLROLE (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FROLEID VARCHAR(50) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);

--T_HIES_DIAETPLROLEORG
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HIES_ENTRYTPLROLEORG')
 CREATE TABLE T_HIES_ENTRYTPLROLEORG (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FORGROLEID VARCHAR(50) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FISINCLUDESUBORG_ROLE CHAR(1) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);

--T_HIES_DIAETPLUSER
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HIES_ENTRYTPLUSER')
 CREATE TABLE T_HIES_ENTRYTPLUSER (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FUSERID BIGINT DEFAULT 0 NOT NULL
);

--T_HIES_DIAECONDFIELDCONF
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HIES_ENTRYCONDFIELDCONF')
 CREATE TABLE T_HIES_ENTRYCONDFIELDCONF (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FCONDNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FCONDENTITYNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FDOWNCONDITIONVAL VARCHAR(2000) DEFAULT ' ' NOT NULL
);

/**End D:\tools\PDM_UPGRADE\PDM1\HIES_table.sql **/
