/**Begin D:\DBA\1.4\PDM_UPGRADE\PDM1\BCM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_DI_ISDERIVERULE') 
 CREATE TABLE T_DI_ISDERIVERULE (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME VARCHAR(200) DEFAULT ' ' NOT NULL,
FSCHEMEID BIGINT DEFAULT 0 NOT NULL,
FCATALOGID BIGINT DEFAULT 0 NOT NULL,
FSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FDESCRIPTION VARCHAR(2000) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_DI_ISDERIVERULE_DETAIL') 
 CREATE TABLE T_DI_ISDERIVERULE_DETAIL (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FBASEFIELDID BIGINT DEFAULT 0 NOT NULL,
FFIELDTYPE VARCHAR(2) DEFAULT '1' NOT NULL,
FCONDITONTYPE VARCHAR(2) DEFAULT '2' NOT NULL,
FCONDITONVALUE VARCHAR(2000) DEFAULT ' ' NOT NULL,
FCODERULE VARCHAR(2) DEFAULT ' ' NOT NULL,
FCODERULEVALUE VARCHAR(10) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_DI_ISDERIVERULE_S') 
 CREATE TABLE T_DI_ISDERIVERULE_S (
FID BIGINT DEFAULT 0 NOT NULL,
FEXTID BIGINT DEFAULT 0 NOT NULL,
FLRULEPREVIEW NCLOB
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_DI_ISDERIVERULE_L') 
 CREATE TABLE T_DI_ISDERIVERULE_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(200) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(2000) DEFAULT ' ' NOT NULL
);



/**End D:\DBA\1.4\PDM_UPGRADE\PDM1\BCM_table.sql **/
