/**Begin D:\zhaohui_zeng\PDM_UPGRADE\PDM1\MRP_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MRP_DATESET') 
 CREATE TABLE T_MRP_DATESET (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MRP_DATESETENTRY') 
 CREATE TABLE T_MRP_DATESETENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FTYPE NVARCHAR(10) DEFAULT ' ' NOT NULL,
FNUM INT DEFAULT 0 NOT NULL,
FISNATURAL CHAR(1) DEFAULT '0' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MRP_PUR_FCTDATA') 
 CREATE TABLE T_MRP_PUR_FCTDATA (
FID BIGINT DEFAULT 0 NOT NULL,
FCACULATELOG NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCREATEDATE DATETIME,
FPLANGRAMID BIGINT DEFAULT 0 NOT NULL,
FDATEINFO NVARCHAR(255) DEFAULT ' ' NOT NULL,
FDATEINFO_TAG NCLOB
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MRP_PUR_FCTENTRY') 
 CREATE TABLE T_MRP_PUR_FCTENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FMATERIALID BIGINT DEFAULT 0 NOT NULL,
FREMARKS NVARCHAR(255) DEFAULT ' ' NOT NULL,
FOPERATOR BIGINT DEFAULT 0 NOT NULL,
FSPLITED NVARCHAR(10) DEFAULT ' ' NOT NULL,
FPUBLISHED CHAR(1) DEFAULT '0' NOT NULL,
FUNITID BIGINT DEFAULT 0 NOT NULL,
FSPLITTIME DATETIME,
FPUBLISHTIME DATETIME,
FPUBLISHER BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FDATATYPE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FMODIFIER BIGINT DEFAULT 0 NOT NULL,
FPLANTAG BIGINT DEFAULT 0 NOT NULL,
FTOTALQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FWASTEQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FDATEQTY NVARCHAR(255) DEFAULT ' ' NOT NULL,
FDATEQTY_TAG NCLOB
);



/**End D:\zhaohui_zeng\PDM_UPGRADE\PDM1\MRP_table.sql **/
