
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MDS_SITERECORD') 
 CREATE TABLE T_MDS_SITERECORD (
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,
FMATERIALID BIGINT DEFAULT 0 NOT NULL,
FCONFIGID BIGINT DEFAULT 0 NOT NULL,
FTRACKID BIGINT DEFAULT 0 NOT NULL,
FRECORDDATE DATETIME,
FBILLROWNO BIGINT DEFAULT 0 NOT NULL,
FBILLID BIGINT DEFAULT 0 NOT NULL,
FBILLENTRYID BIGINT DEFAULT 0 NOT NULL,
FBILLUNIT BIGINT DEFAULT 0 NOT NULL,
FSITESCHEMEID BIGINT DEFAULT 0 NOT NULL,
FBILLTAG VARCHAR(50) DEFAULT ' ' NOT NULL,
FUNDISTQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSOURCEQTY DECIMAL(23,10) DEFAULT 0 NOT NULL,
FSALEORG BIGINT DEFAULT 0 NOT NULL,
FSTOCKOUTQTY DECIMAL(23,10) DEFAULT 0 NOT NULL
);

