/**Begin D:\zhaohui_zeng\PDM_UPGRADE\PDM1\MRP_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MRP_REPLACE_LOG') 
 CREATE TABLE T_MRP_REPLACE_LOG (
FID BIGINT DEFAULT 0 NOT NULL,
FRUNLOGNO NVARCHAR(100) DEFAULT ' ' NOT NULL,
FREPLACESTRA NVARCHAR(30) DEFAULT ' ' NOT NULL,
FMATERIAL BIGINT DEFAULT 0 NOT NULL,
FUNIT BIGINT DEFAULT 0 NOT NULL,
FREPLACEMETHOD NVARCHAR(30) DEFAULT ' ' NOT NULL,
FREPQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FREQUIREQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FREPMATERIAL BIGINT DEFAULT 0 NOT NULL,
FREQUNIT BIGINT DEFAULT 0 NOT NULL,
FREPLACE BIGINT DEFAULT 0 NOT NULL,
FSOURCENO NVARCHAR(512) DEFAULT ' ' NOT NULL,
FRUNLOG BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MRP_REP_LOG_M_ENTRY') 
 CREATE TABLE T_MRP_REP_LOG_M_ENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FENTRYMATERIAL BIGINT DEFAULT 0 NOT NULL,
FENTRYQTY DECIMAL(23,10) DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MRP_REP_LOG_R_ENTRY') 
 CREATE TABLE T_MRP_REP_LOG_R_ENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FENTRYMATERIAL BIGINT DEFAULT 0 NOT NULL,
FENTRYQTY DECIMAL(23,10) DEFAULT 0 NOT NULL
);



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