/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\EB_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_ACCOUNTRULEFORMULA') 
 CREATE TABLE T_EB_ACCOUNTRULEFORMULA (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(510) DEFAULT ' ' NOT NULL,
FDESCRIPTION_TAG NCLOB,
FACCOUNT BIGINT DEFAULT 0 NOT NULL,
FMETRIC BIGINT DEFAULT 0 NOT NULL,
FDATATYPE BIGINT DEFAULT 0 NOT NULL,
FFORMULA NVARCHAR(510) DEFAULT ' ' NOT NULL,
FFORMULA_TAG NCLOB,
FSTATUS CHAR(1) DEFAULT '1' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FCREATOR BIGINT DEFAULT 0 NOT NULL,
FMODIFIER BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_FORMULACONDITION') 
 CREATE TABLE T_EB_FORMULACONDITION (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FDIMMEMB BIGINT DEFAULT 0 NOT NULL,
FMEMBERMODEL NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDIMENSION BIGINT DEFAULT 0 NOT NULL,
FRELATION NVARCHAR(30) DEFAULT ' ' NOT NULL,
FMEMBRANGE NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_FORMULAVARIATE') 
 CREATE TABLE T_EB_FORMULAVARIATE (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FVARIATE NVARCHAR(100) DEFAULT ' ' NOT NULL,
FREFACCOUNT BIGINT DEFAULT 0 NOT NULL,
FPERIODOFF BIGINT DEFAULT 0 NOT NULL,
FREFMETRIC BIGINT DEFAULT 0 NOT NULL,
FUSERDEFINED1 BIGINT DEFAULT 0 NOT NULL,
FUSERDEFINED2 BIGINT DEFAULT 0 NOT NULL,
FUSERDEFINED3 BIGINT DEFAULT 0 NOT NULL,
FUSERDEFINED4 BIGINT DEFAULT 0 NOT NULL,
FUSERDEFINED5 BIGINT DEFAULT 0 NOT NULL,
FUSERDEFINED6 BIGINT DEFAULT 0 NOT NULL,
FUSERDEFINED7 BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL
);



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\EB_table.sql **/
