/**Begin D:\k3Cloud\PDM_UPGRADE\PDM1\MDS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MDS_SETOFFDIM')
CREATE TABLE T_MDS_SETOFFDIM (
    FSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
    FCREATORID BIGINT DEFAULT 0 NOT NULL,
    FCREATETIME DATETIME,
    FCREATEORGID BIGINT DEFAULT 0 NOT NULL,
    FSOURCEDATAID BIGINT DEFAULT 0 NOT NULL,
    FMODIFYTIME DATETIME,
    FORGID BIGINT DEFAULT 0 NOT NULL,
    FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
    FCTRLSTRATEGY VARCHAR(30) DEFAULT ' ' NOT NULL,
    FBITINDEX BIGINT DEFAULT 0 NOT NULL,
    FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
    FMASTERID BIGINT DEFAULT 0 NOT NULL,
    FENABLE VARCHAR(30) DEFAULT ' ' NOT NULL,
    FSOURCEBITINDEX BIGINT DEFAULT 0 NOT NULL,
    FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
    FID BIGINT DEFAULT 0 NOT NULL,
    FSTATUS VARCHAR(30) DEFAULT ' ' NOT NULL
);

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

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MDS_SETOFFDIM_ENTRY')
CREATE TABLE T_MDS_SETOFFDIM_ENTRY (
    FFIELDNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
    FID BIGINT DEFAULT 0 NOT NULL,
    FREQFIELDNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
    FREQFIELDKEY NVARCHAR(50) DEFAULT ' ' NOT NULL,
    FPROFIELDNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
    FENABLESTATUS CHAR(1) DEFAULT '0' NOT NULL,
    FENTRYID BIGINT DEFAULT 0 NOT NULL,
    FPROFIELDKEY NVARCHAR(50) DEFAULT ' ' NOT NULL,
    FFIXEDDIM CHAR(1) DEFAULT '0' NOT NULL,
    FSEQ BIGINT DEFAULT 0 NOT NULL
);


/**End D:\k3Cloud\PDM_UPGRADE\PDM1\MDS_table.sql **/
