IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MRP_SUPDEM_RANGE')
 CREATE TABLE T_MRP_SUPDEM_RANGE (
FID                  BIGINT               NOT NULL DEFAULT 0,
FCREATER             BIGINT               NOT NULL DEFAULT 0,
FMODIFIER            BIGINT               NOT NULL DEFAULT 0,
FCREATEDATE          DATETIME             NULL,
FMODIFYDATE          DATETIME             NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MRP_SUPDEM_DEM')
 CREATE TABLE T_MRP_SUPDEM_DEM (
FID           BIGINT               NOT NULL DEFAULT 0,
FENTRYID      BIGINT               NOT NULL DEFAULT 0,
FSEQ          INT                  NOT NULL DEFAULT 0,
FDEMANDCONFIG BIGINT               NOT NULL DEFAULT 0
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MRP_SUPDEM_SUP')
 CREATE TABLE T_MRP_SUPDEM_SUP (
FID           BIGINT               NOT NULL DEFAULT 0,
FENTRYID      BIGINT               NOT NULL DEFAULT 0,
FSEQ          INT                  NOT NULL DEFAULT 0,
FSUPPLYCONFIG BIGINT               NOT NULL DEFAULT 0
);