/**Begin D:\k3Cloud\PDM_UPGRADE\PDM1\MDS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_POM_DISTRIBPLANX') 
 CREATE TABLE T_POM_DISTRIBPLANX (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(80) DEFAULT ' ' NOT NULL,
FBILLSTATUS VARCHAR(5) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FMODIFYTIME DATETIME,
FCREATETIME DATETIME,
FORGID BIGINT DEFAULT 0 NOT NULL,
FREQTIME DATETIME,
FMATERIAL BIGINT DEFAULT 0 NOT NULL,
FUNIT BIGINT DEFAULT 0 NOT NULL,
FREQQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCANSENDQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSENDEDQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FUNSENDQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FMFTNO VARCHAR(80) DEFAULT ' ' NOT NULL,
FPRODMATERIAL BIGINT DEFAULT 0 NOT NULL,
FPRODUNIT BIGINT DEFAULT 0 NOT NULL,
FWORKPROC BIGINT DEFAULT 0 NOT NULL,
FWORKCENTER BIGINT DEFAULT 0 NOT NULL,
FWORKSTATION BIGINT DEFAULT 0 NOT NULL,
FREQORG BIGINT DEFAULT 0 NOT NULL,
FSUPPLYORG BIGINT DEFAULT 0 NOT NULL,
FWAREHOUSE BIGINT DEFAULT 0 NOT NULL,
FSTOCKLOCAT BIGINT DEFAULT 0 NOT NULL,
FCLOSETYPE VARCHAR(5) DEFAULT ' ' NOT NULL,
FCLOSETIME DATETIME,
FPROJECT BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_POM_DISTRIBPLANXENT') 
 CREATE TABLE T_POM_DISTRIBPLANXENT (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FSOURCEBILLNO VARCHAR(80) DEFAULT ' ' NOT NULL,
FPRODMTNO BIGINT DEFAULT 0 NOT NULL,
FMATERIALID BIGINT DEFAULT 0 NOT NULL,
FMTUNIT BIGINT DEFAULT 0 NOT NULL,
FRQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCANSQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSEDQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FUNSQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FWKPROC BIGINT DEFAULT 0 NOT NULL,
FWKCENTER BIGINT DEFAULT 0 NOT NULL,
FWKSTATION BIGINT DEFAULT 0 NOT NULL,
FPRODORG BIGINT DEFAULT 0 NOT NULL,
FSUPORG BIGINT DEFAULT 0 NOT NULL,
FWRHOUSE BIGINT DEFAULT 0 NOT NULL,
FSTOCKLOC BIGINT DEFAULT 0 NOT NULL,
FSOURCEBILLENRTYID VARCHAR(80) DEFAULT ' ' NOT NULL,
FSOURCEBILLENTRYNAME VARCHAR(100) DEFAULT ' ' NOT NULL,
FSOURCEBILLID VARCHAR(80) DEFAULT ' ' NOT NULL,
FSOURCEBILLNAME VARCHAR(100) DEFAULT ' ' NOT NULL,
FECLOSETYPE VARCHAR(80) DEFAULT ' ' NOT NULL,
FOWNORG BIGINT DEFAULT 0 NOT NULL,
FISPUSHED CHAR(1) DEFAULT '0' NOT NULL,
FENTRYCREATOR BIGINT DEFAULT 0 NOT NULL,
FENTRYCREATETIME DATETIME,
FENTRYMODIFIER BIGINT DEFAULT 0 NOT NULL,
FENTRYMODIFYTIME DATETIME,
FENTPROPJECT BIGINT DEFAULT 0 NOT NULL
);



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