/**Begin D:\PDM_UPGRADE\PDM1\EB_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_BASECVTFORMULA') 
 CREATE TABLE T_EB_BASECVTFORMULA (
FID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FSCENARIOID BIGINT DEFAULT 0 NOT NULL,
FBALANCE INT DEFAULT 0 NOT NULL,
FPROFITLOSS INT DEFAULT 0 NOT NULL,
FRIGHTS INT DEFAULT 0 NOT NULL,
FMODIFIER BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FEXCHAGERATEID BIGINT DEFAULT 0 NOT NULL,
FISAUTOCONVERT CHAR(1) DEFAULT '1' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_BEGINPERIODDIMS') 
 CREATE TABLE T_EB_BEGINPERIODDIMS (
FID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FTEMPLATEID BIGINT DEFAULT 0 NOT NULL,
FACCOUNTID BIGINT DEFAULT 0 NOT NULL,
FCHANGETYPE CHAR(1) DEFAULT '1' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_BREXECINFO') 
 CREATE TABLE T_EB_BREXECINFO (
FID BIGINT DEFAULT 0 NOT NULL,
FBIZRULEID BIGINT DEFAULT 0 NOT NULL,
FSTARTTIME DATETIME,
FENDTIME DATETIME,
FEXECSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FEXECUTORID BIGINT DEFAULT 0 NOT NULL,
FREASON NCLOB,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FSCENARIO BIGINT DEFAULT 0 NOT NULL,
FYEAR BIGINT DEFAULT 0 NOT NULL,
FPERIOD BIGINT DEFAULT 0 NOT NULL,
FCURRENCY BIGINT DEFAULT 0 NOT NULL,
FBIZRULECATALOG BIGINT DEFAULT 0 NOT NULL,
FENTITY BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_CONFIGSETTING') 
 CREATE TABLE T_EB_CONFIGSETTING (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(1000) DEFAULT ' ' NOT NULL,
FCONFIG NVARCHAR(10) DEFAULT ' ' NOT NULL,
FDESCRIPTIOIN NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FMODIFYTIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FORMID VARCHAR(50) DEFAULT ' ' NOT NULL,
FISENABLE CHAR(1) DEFAULT '1' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_DISTRIBUTION') 
 CREATE TABLE T_EB_DISTRIBUTION (
FID BIGINT DEFAULT 0 NOT NULL,
FMODEL BIGINT DEFAULT 0 NOT NULL,
FENTITY BIGINT DEFAULT 0 NOT NULL,
FRANGE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FTEMPLATE BIGINT DEFAULT 0 NOT NULL,
FPROPERTY BIGINT DEFAULT 0 NOT NULL,
FPROPERTYVALUE BIGINT DEFAULT 0 NOT NULL,
FTEXTNAME NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_EBAPPROVEBILL') 
 CREATE TABLE T_EB_EBAPPROVEBILL (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO NVARCHAR(100) DEFAULT ' ' NOT NULL,
FEBORGMASTERID BIGINT DEFAULT 0 NOT NULL,
FAPPROVEINFO NVARCHAR(510) DEFAULT ' ' NOT NULL,
FBILLSTATUS NVARCHAR(2) DEFAULT '1' NOT NULL,
FBILLTYPE NVARCHAR(2) DEFAULT '0' NOT NULL,
FEBORGID BIGINT DEFAULT 0 NOT NULL,
FAPPROVETEMPID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FDIMDATATYPE BIGINT DEFAULT 0 NOT NULL,
FDIMYEAR NVARCHAR(20) DEFAULT ' ' NOT NULL,
FDIMPERIOD NVARCHAR(10) DEFAULT ' ' NOT NULL,
FDIMVERSION NVARCHAR(30) DEFAULT ' ' NOT NULL,
FAPPROVERID BIGINT DEFAULT 0 NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FCREATERID BIGINT DEFAULT 0 NOT NULL,
FAPPROVEDATE DATETIME,
FCREATEDATE DATETIME,
FHANDLER BIGINT DEFAULT 0 NOT NULL,
FDIMENSIONJSON NCLOB,
FDEALDATE DATETIME,
FHANDLERTEXT NVARCHAR(20) DEFAULT ' ' NOT NULL,
FAPPINDEXID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_EBAPPROVEBILLENTRY') 
 CREATE TABLE T_EB_EBAPPROVEBILLENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FTEMPID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FTASKPROCESSID BIGINT DEFAULT 0 NOT NULL,
FPAGEDIMJSON NCLOB,
FTASKPROCESSJSON NCLOB,
FAPPINDEXID NVARCHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_EBBIZRULEGLOBAL') 
 CREATE TABLE T_EB_EBBIZRULEGLOBAL (
FID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FVERSION INT DEFAULT 0 NOT NULL,
FGLOBALENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_EBTEMPLATE') 
 CREATE TABLE T_EB_EBTEMPLATE (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(500) DEFAULT ' ' NOT NULL,
FTEMPLATECATALOGID BIGINT DEFAULT 0 NOT NULL,
FVERSIONNUMBER DECIMAL(5,2) DEFAULT 0 NOT NULL,
FVERSIONSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FUSAGE CHAR(1) DEFAULT ' ' NOT NULL,
FISONLYREAD CHAR(1) DEFAULT ' ' NOT NULL,
FEDITDESCRIPTION NCLOB,
FSPREADJSON NCLOB,
FDATA NCLOB,
FRPTDATA NCLOB,
FRPTSPREADJSON NCLOB,
FCREATETIME DATETIME,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FGROUP BIGINT DEFAULT 0 NOT NULL,
FISFINTEMPLATE CHAR(1) DEFAULT '1' NOT NULL,
FTEMPLATETYPE CHAR(1) DEFAULT '0' NOT NULL,
FISSHOWEDITDESCRIPTION CHAR(1) DEFAULT '0' NOT NULL,
FSEQUENCE INT DEFAULT 0 NOT NULL,
FEFFECTIVEDATE DATETIME,
FISOLDTEMPLATE CHAR(1) DEFAULT '1' NOT NULL,
FVARBASEFOREB NVARCHAR(80) DEFAULT ' ' NOT NULL,
FVARJSONFOREB NCLOB,
FVERSIONDESCRIPTION NVARCHAR(500) DEFAULT ' ' NOT NULL,
FEXPIRINGDATE DATETIME,
FSTATUS CHAR(1) DEFAULT '0' NOT NULL,
FISSAVEBYDIM CHAR(1) DEFAULT '1' NOT NULL,
FISAUTOCALCULATE CHAR(1) DEFAULT '0' NOT NULL,
FISALLOWADDIC CHAR(1) DEFAULT '1' NOT NULL,
FACCOUNTRECLASS CHAR(1) DEFAULT '1' NOT NULL,
FISCIRCULARDEFINE CHAR(1) DEFAULT '0' NOT NULL,
FISCHECKSTATUS CHAR(1) DEFAULT '0' NOT NULL,
FUNCHECKENTITY NCLOB
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_EBTEMPLATE_L') 
 CREATE TABLE T_EB_EBTEMPLATE_L (
FPKID NVARCHAR(30) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID NVARCHAR(20) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(500) DEFAULT ' ' NOT NULL,
FEDITDESCRIPTION NCLOB,
FVERSIONDESCRIPTION NVARCHAR(500) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_EBTEMPLATECATALOG') 
 CREATE TABLE T_EB_EBTEMPLATECATALOG (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(60) DEFAULT ' ' NOT NULL,
FSTATUS NVARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FENABLE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FLONGNUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL,
FLEVEL INT DEFAULT 0 NOT NULL,
FISLEAF CHAR(1) DEFAULT ' ' NOT NULL,
FPARENTID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FMODELORG BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FSEQUENCE INT DEFAULT 0 NOT NULL,
FNAME NVARCHAR(500) DEFAULT ' ' NOT NULL,
FCATALOGTYPE CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_EBTEMPLATECATALOG_L') 
 CREATE TABLE T_EB_EBTEMPLATECATALOG_L (
FPKID NVARCHAR(30) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID NVARCHAR(20) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(500) DEFAULT ' ' NOT NULL,
FFULLNAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_FORMULAREGISTER') 
 CREATE TABLE T_EB_FORMULAREGISTER (
FID BIGINT DEFAULT 0 NOT NULL,
FCLOUDID VARCHAR(20) DEFAULT ' ' NOT NULL,
FAPPID VARCHAR(20) DEFAULT ' ' NOT NULL,
FSERVICE VARCHAR(100) DEFAULT ' ' NOT NULL,
FMETHOD VARCHAR(100) DEFAULT ' ' NOT NULL,
FISENABLE CHAR(1) DEFAULT '1' NOT NULL,
FCLASSPATH VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_INTERGRATION') 
 CREATE TABLE T_EB_INTERGRATION (
FID BIGINT DEFAULT 0 NOT NULL,
FTEMPLATEID BIGINT DEFAULT 0 NOT NULL,
FENTITYID BIGINT DEFAULT 0 NOT NULL,
FYEARID BIGINT DEFAULT 0 NOT NULL,
FPERIODID BIGINT DEFAULT 0 NOT NULL,
FCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FACCOUNTID BIGINT DEFAULT 0 NOT NULL,
FSCENEID BIGINT DEFAULT 0 NOT NULL,
FPROCESSID BIGINT DEFAULT 0 NOT NULL,
FAUDITTRAILID BIGINT DEFAULT 0 NOT NULL,
FCHANGETYPEID BIGINT DEFAULT 0 NOT NULL,
FCOMPANYID BIGINT DEFAULT 0 NOT NULL,
FMULTIGAAPID BIGINT DEFAULT 0 NOT NULL,
FDIM1 BIGINT DEFAULT 0 NOT NULL,
FDIM2 BIGINT DEFAULT 0 NOT NULL,
FDIM3 BIGINT DEFAULT 0 NOT NULL,
FDIM4 BIGINT DEFAULT 0 NOT NULL,
FDIM5 BIGINT DEFAULT 0 NOT NULL,
FDIM6 BIGINT DEFAULT 0 NOT NULL,
FDATAFROM NCLOB,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FORGLONGNUMBER NVARCHAR(255) DEFAULT ' ' NOT NULL,
FDIMKEY NVARCHAR(100) DEFAULT ' ' NOT NULL,
FMEMBKEY NVARCHAR(100) DEFAULT ' ' NOT NULL,
FFLOATAREA NVARCHAR(25) DEFAULT ' ' NOT NULL,
FMYCOMPANYID BIGINT DEFAULT 0 NOT NULL,
FDATASORTID BIGINT DEFAULT 0 NOT NULL,
FFLOATINDEX NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_MERGECONTROLENTITY') 
 CREATE TABLE T_EB_MERGECONTROLENTITY (
FID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FYEARID BIGINT DEFAULT 0 NOT NULL,
FPERIODID BIGINT DEFAULT 0 NOT NULL,
FSCENARIOID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FYBCARRIED CHAR(1) DEFAULT ' ' NOT NULL,
FDATACOLLECT CHAR(1) DEFAULT ' ' NOT NULL,
FCALCULATESTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FFLOWSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FARTICULATIONCHKSTA CHAR(1) DEFAULT ' ' NOT NULL,
FPCCALCULATESTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FPCFLOWSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FPCARTICULATIONCHKSTA CHAR(1) DEFAULT ' ' NOT NULL,
FRATIOMERGE CHAR(1) DEFAULT ' ' NOT NULL,
FADJUST CHAR(1) DEFAULT ' ' NOT NULL,
FOFFSET CHAR(1) DEFAULT ' ' NOT NULL,
FMERGECONTRIBUTION CHAR(1) DEFAULT ' ' NOT NULL,
FRPTSUM CHAR(1) DEFAULT ' ' NOT NULL,
FADJUSTSUM CHAR(1) DEFAULT ' ' NOT NULL,
FOFFSETSUM CHAR(1) DEFAULT ' ' NOT NULL,
FMERGESUM CHAR(1) DEFAULT ' ' NOT NULL,
FBEGINTIME DATETIME,
FENDTIME DATETIME,
FMERGEDATASOURCE CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_MERGEDATASET') 
 CREATE TABLE T_EB_MERGEDATASET (
FID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FYEARID BIGINT DEFAULT 0 NOT NULL,
FPERIODID BIGINT DEFAULT 0 NOT NULL,
FSCENARIOID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FMERGEDATASOURCE CHAR(1) DEFAULT '1' NOT NULL,
FMODIFIER BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_NOFINANCIALFILE') 
 CREATE TABLE T_EB_NOFINANCIALFILE (
FID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FMODEL BIGINT DEFAULT 0 NOT NULL,
FYEAR BIGINT DEFAULT 0 NOT NULL,
FPERIOD BIGINT DEFAULT 0 NOT NULL,
FCURRENCY BIGINT DEFAULT 0 NOT NULL,
FENTITY BIGINT DEFAULT 0 NOT NULL,
FTEMPLATE BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(255) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FTEXT NCLOB,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_NOFINANCIALFILE_L') 
 CREATE TABLE T_EB_NOFINANCIALFILE_L (
FPKID NVARCHAR(30) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID NVARCHAR(20) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_PAGEDIMSELECT') 
 CREATE TABLE T_EB_PAGEDIMSELECT (
FID BIGINT DEFAULT 0 NOT NULL,
FDIMENSION BIGINT DEFAULT 0 NOT NULL,
FMEMBER BIGINT DEFAULT 0 NOT NULL,
FTEMPLATE BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_PERIODMANAGEENTITY') 
 CREATE TABLE T_EB_PERIODMANAGEENTITY (
FID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FYEARID BIGINT DEFAULT 0 NOT NULL,
FPERIODID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSCENARIOID BIGINT DEFAULT 0 NOT NULL,
FDATASTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FENTRYSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FEXECUTEACTION CHAR(1) DEFAULT ' ' NOT NULL,
FOPTIME DATETIME,
FOPERATOR BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_RDATA_CUSTSET') 
 CREATE TABLE T_EB_RDATA_CUSTSET (
FID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(100) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(300) DEFAULT ' ' NOT NULL,
FISSYSTEM CHAR(1) DEFAULT '1' NOT NULL,
FSCHEMETYPE VARCHAR(50) DEFAULT 'singleec' NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_RDATA_DETAIL') 
 CREATE TABLE T_EB_RDATA_DETAIL (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FDIMENSIONID BIGINT DEFAULT 0 NOT NULL,
FDIMENSIONMEMBERID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_REPORT') 
 CREATE TABLE T_EB_REPORT (
FID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FFYID BIGINT DEFAULT 0 NOT NULL,
FPERIODID BIGINT DEFAULT 0 NOT NULL,
FSCENEID BIGINT DEFAULT 0 NOT NULL,
FCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FENTITYID BIGINT DEFAULT 0 NOT NULL,
FTEMPLATEID BIGINT DEFAULT 0 NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FSENDBACKERID BIGINT DEFAULT 0 NOT NULL,
FSENDBACKTIME DATETIME,
FSENDBACKTIMES INT DEFAULT 0 NOT NULL,
FCOMMITORID BIGINT DEFAULT 0 NOT NULL,
FCOMMITTIME DATETIME,
FFIRSTCOMMITTIME DATETIME,
FCOMMITTIMES INT DEFAULT 0 NOT NULL,
FCOMPLETERID BIGINT DEFAULT 0 NOT NULL,
FCOMPLETETIME DATETIME,
FREPORTSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FNOFIN BIGINT DEFAULT 0 NOT NULL,
FSPREADJSON NCLOB,
FDATA NCLOB,
FREPORTTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FVERSIONID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_REPORTLIST') 
 CREATE TABLE T_EB_REPORTLIST (
FID BIGINT DEFAULT 0 NOT NULL,
FTEMPLATEID BIGINT DEFAULT 0 NOT NULL,
FREPORTID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FFYEARID BIGINT DEFAULT 0 NOT NULL,
FPERIODID BIGINT DEFAULT 0 NOT NULL,
FSCENEID BIGINT DEFAULT 0 NOT NULL,
FCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FENTITYID BIGINT DEFAULT 0 NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FREPORTSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FGROUPID NVARCHAR(200) DEFAULT ' ' NOT NULL,
FCHECKRESULT CHAR(1) DEFAULT '1' NOT NULL,
FPROCESS NVARCHAR(200) DEFAULT ' ' NOT NULL,
FVERSIONID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_STATUS') 
 CREATE TABLE T_EB_STATUS (
FID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FTEMPLATEID BIGINT DEFAULT 0 NOT NULL,
FORG BIGINT DEFAULT 0 NOT NULL,
FSCENARIO BIGINT DEFAULT 0 NOT NULL,
FYEAR BIGINT DEFAULT 0 NOT NULL,
FPERIOD BIGINT DEFAULT 0 NOT NULL,
FCURRENCY BIGINT DEFAULT 0 NOT NULL,
FPROCESS BIGINT DEFAULT 0 NOT NULL,
FAUDITTRAIL BIGINT DEFAULT 0 NOT NULL,
FCHECKEDSTATUS CHAR(1) DEFAULT '0' NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_TASKCONF') 
 CREATE TABLE T_EB_TASKCONF (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FTASKTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FSTARTTIME DATETIME,
FENDTIME DATETIME,
FPLANUSETIME INT DEFAULT 0 NOT NULL,
FTEMPLATES BIGINT DEFAULT 0 NOT NULL,
FPRETASKS BIGINT DEFAULT 0 NOT NULL,
FDISCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FWARNBEGINTYPE INT DEFAULT 0 NOT NULL,
FWARNINGBEGINTIME DATETIME,
FWARNFREQUENCY INT DEFAULT 0 NOT NULL,
FOUTFREQUENCY INT DEFAULT 0 NOT NULL,
FTASKSTATUS VARCHAR(1) DEFAULT ' ' NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODEL BIGINT DEFAULT 0 NOT NULL,
FLONGNUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL,
FLEVEL INT DEFAULT 0 NOT NULL,
FISLEAF CHAR(1) DEFAULT ' ' NOT NULL,
FPARENTID BIGINT DEFAULT 0 NOT NULL,
FTASKCATALOGID BIGINT DEFAULT 0 NOT NULL,
FKSEQ INT DEFAULT 0 NOT NULL,
FFINISHSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(200) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_TASKCONF_L') 
 CREATE TABLE T_EB_TASKCONF_L (
FPKID NVARCHAR(18) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID NVARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(200) DEFAULT ' ' NOT NULL,
FDISCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_TASKDISPTEM') 
 CREATE TABLE T_EB_TASKDISPTEM (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FTEMPLATEID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ NVARCHAR(20) DEFAULT ' ' NOT NULL
);


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


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_TASKPARAM') 
 CREATE TABLE T_EB_TASKPARAM (
FID BIGINT DEFAULT 0 NOT NULL,
FPERIODID BIGINT DEFAULT 0 NOT NULL,
FYEARID BIGINT DEFAULT 0 NOT NULL,
FTASKCATALOGID BIGINT DEFAULT 0 NOT NULL,
FCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FSCENARIOID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_TASKSTATUS') 
 CREATE TABLE T_EB_TASKSTATUS (
FID BIGINT DEFAULT 0 NOT NULL,
FENTITYID BIGINT DEFAULT 0 NOT NULL,
FREPORTTASKID BIGINT DEFAULT 0 NOT NULL,
FTEMPLATEID BIGINT DEFAULT 0 NOT NULL,
FTASKSTATUS CHAR(1) DEFAULT '0' NOT NULL,
FTASKTYPE CHAR(1) DEFAULT '3' NOT NULL,
FROOTID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FFYID BIGINT DEFAULT 0 NOT NULL,
FPERIODID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FREPORTSTATUS CHAR(1) DEFAULT 'A' NOT NULL,
FCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FSCENARIOID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_TMPLCOLDIM') 
 CREATE TABLE T_EB_TMPLCOLDIM (
FDETAILID BIGINT DEFAULT 0 NOT NULL,
FMEMBERID BIGINT DEFAULT 0 NOT NULL,
FDIMENSIONID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FCOLGROUPID BIGINT DEFAULT 0 NOT NULL,
FCOLINDEX INT DEFAULT 0 NOT NULL,
FDISPLAYCHILD CHAR(1) DEFAULT '0' NOT NULL,
FFORMULA NVARCHAR(1000) DEFAULT ' ' NOT NULL,
FHEADER VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_TMPLCOLDIM_L') 
 CREATE TABLE T_EB_TMPLCOLDIM_L (
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FDETAILID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(20) DEFAULT ' ' NOT NULL,
FHEADER VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_TMPLDIMPOSITION') 
 CREATE TABLE T_EB_TMPLDIMPOSITION (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FAREARANGE VARCHAR(30) DEFAULT ' ' NOT NULL,
FSTARTPOSITION VARCHAR(30) DEFAULT ' ' NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_TMPLPAGEDIM') 
 CREATE TABLE T_EB_TMPLPAGEDIM (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FMEMBERID BIGINT DEFAULT 0 NOT NULL,
FMEMBBOUND INT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FDIMENSIONID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_TMPLPAGEDIMPROP') 
 CREATE TABLE T_EB_TMPLPAGEDIMPROP (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FDIMENSIONID BIGINT DEFAULT 0 NOT NULL,
FPROPERTYID BIGINT DEFAULT 0 NOT NULL,
FMEMBPROPID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FPROPBOUND INT DEFAULT 10 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_TMPLROWDIM') 
 CREATE TABLE T_EB_TMPLROWDIM (
FDETAILID BIGINT DEFAULT 0 NOT NULL,
FMEMBERID BIGINT DEFAULT 0 NOT NULL,
FDIMENSIONID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FMEMBSCOPE INT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_TMPLVIEWPOINTDIM') 
 CREATE TABLE T_EB_TMPLVIEWPOINTDIM (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FMEMBERID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FDIMENSIONID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_UDCFROWCOLMEMB') 
 CREATE TABLE T_EB_UDCFROWCOLMEMB (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FDIMENSIONNUM NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMEMBERNUM NVARCHAR(50) DEFAULT ' ' NOT NULL,
FMEMBBOUND INT DEFAULT 0 NOT NULL,
FPROPERTYVALUEID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_UPDATERECORD') 
 CREATE TABLE T_EB_UPDATERECORD (
FID BIGINT DEFAULT 0 NOT NULL,
FVERSION NVARCHAR(30) DEFAULT ' ' NOT NULL,
FUPDATETIME DATETIME,
FSIGN NVARCHAR(30) DEFAULT ' ' NOT NULL,
FLOGINFO NCLOB,
FSTATUS CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_USERDEFCVTFORMULA') 
 CREATE TABLE T_EB_USERDEFCVTFORMULA (
FID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FSCENARIOID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FTEMPLATEID BIGINT DEFAULT 0 NOT NULL,
FCONVERTFORMULA NVARCHAR(1000) DEFAULT ' ' NOT NULL,
FEXECUTIONORDER INT DEFAULT 1 NOT NULL,
FDESCRIPTION NVARCHAR(500) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIER BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FCVTFORMULAECHOED VARCHAR(1000) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_DATASOURCE') 
 CREATE TABLE T_EB_DATASOURCE (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FSERVERADDRESS VARCHAR(50) DEFAULT ' ' NOT NULL,
FPORT INT DEFAULT 0 NOT NULL,
FUSERNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FPASSWORD VARCHAR(50) DEFAULT ' ' NOT NULL,
FDISCRIPTION VARCHAR(255) DEFAULT ' ' NOT NULL,
FCREATERFIELD BIGINT DEFAULT 0 NOT NULL,
FMODIFIERFIELD BIGINT DEFAULT 0 NOT NULL,
FQUOTE CHAR(1) DEFAULT '0' NOT NULL,
FDATACONNECT VARCHAR(200) DEFAULT ' ' NOT NULL
);





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