CREATE TABLE msc_atp_rules (
    RULE_ID                           NUMBER(18, 0),
    SPLIT_ORDER_FLAG                  NUMBER(1, 0) ,
    MINIMUM_SPLIT_QUANTITY            NUMBER       ,
    ATP_TIME_FENCE                    NUMBER       ,
    ATP_TIME_FENCE_UD                 NUMBER       ,
    PROFITABLE_TO_PROMISE_CODE        NUMBER       ,
    SUPPLY_CHAIN_SEARCH_CODE          NUMBER       ,
    SEARCH_COMPONENTS_CODE            NUMBER       ,
    INCLUDE_PLANNED_SUPPLY            NUMBER       ,
    LEAD_TIME_CODE                    NUMBER       ,
    LEAD_TIME_TYPE                    NUMBER       ,
    LEAD_TIME_DAYS_UD                 NUMBER       ,
    ALLOCATED_ATP_CODE                NUMBER       ,
    SR_INSTANCE_ID                    NUMBER(18, 0)    NOT NULL,
    RULE_NAME                         VARCHAR2(320)    NOT NULL,
    LAST_UPDATE_DATE                  TIMESTAMP(6)     NOT NULL,
    LAST_UPDATED_BY                   VARCHAR2(256)    NOT NULL,
    CREATION_DATE                     TIMESTAMP(6)     NOT NULL,
    CREATED_BY                        VARCHAR2(256)    NOT NULL,
    LAST_UPDATE_LOGIN                 VARCHAR2(128),
    DESCRIPTION                       VARCHAR2(960),
    PAST_DUE_DEMAND_CUTOFF_FENCE      NUMBER       ,
    PAST_DUE_SUPPLY_CUTOFF_FENCE      NUMBER       ,
    INFINITE_AVAILABLE_CODE           NUMBER       ,
    INFINITE_SUPPLY_FENCE_CODE        NUMBER       ,
    INFINITE_SUPPLY_TIME_FENCE_UD     NUMBER       ,
    ACCEPTABLE_EARLY_FENCE            NUMBER       ,
    ACCEPTABLE_LATE_FENCE             NUMBER       ,
    DEFAULT_ATP_SOURCES               NUMBER       ,
    DEMAND_CLASS_ATP_FLAG             NUMBER       ,
    INCLUDE_SALES_ORDERS              NUMBER           NOT NULL,
    INCLUDE_DISCRETE_WIP_DEMAND       NUMBER       ,
    INCLUDE_DEPENDENT_WIP_DEMAND      NUMBER       ,
    INCLUDE_REP_WIP_DEMAND            NUMBER       ,
    INCLUDE_NONSTD_WIP_DEMAND         NUMBER       ,
    INCLUDE_DISCRETE_MPS              NUMBER       ,
    MPS_DESIGNATOR                    VARCHAR2(40) ,
    INCLUDE_USER_DEFINED_DEMAND       NUMBER           NOT NULL,
    USER_ATP_DEMAND_TABLE_NAME        VARCHAR2(120),
    INCLUDE_PURCHASE_ORDERS           NUMBER           NOT NULL,
    INCLUDE_DISCRETE_WIP_RECEIPTS     NUMBER           NOT NULL,
    INCLUDE_REP_WIP_RECEIPTS          NUMBER           NOT NULL,
    INCLUDE_NONSTD_WIP_RECEIPTS       NUMBER           NOT NULL,
    INCLUDE_INTERORG_TRANSFERS        NUMBER           NOT NULL,
    INCLUDE_ONHAND_AVAILABLE          NUMBER           NOT NULL,
    INCLUDE_USER_DEFINED_SUPPLY       NUMBER           NOT NULL,
    USER_ATP_SUPPLY_TABLE_NAME        VARCHAR2(120),
    ATTRIBUTE_CATEGORY                VARCHAR2(120),
    ATTRIBUTE1                        VARCHAR2(600),
    ATTRIBUTE2                        VARCHAR2(600),
    ATTRIBUTE3                        VARCHAR2(600),
    ATTRIBUTE4                        VARCHAR2(600),
    ATTRIBUTE5                        VARCHAR2(600),
    ATTRIBUTE6                        VARCHAR2(600),
    ATTRIBUTE7                        VARCHAR2(600),
    ATTRIBUTE8                        VARCHAR2(600),
    ATTRIBUTE9                        VARCHAR2(600),
    ATTRIBUTE10                       VARCHAR2(600),
    ATTRIBUTE11                       VARCHAR2(600),
    ATTRIBUTE12                       VARCHAR2(600),
    ATTRIBUTE13                       VARCHAR2(600),
    ATTRIBUTE14                       VARCHAR2(600),
    ATTRIBUTE15                       VARCHAR2(600),
    ACCUMULATION_WINDOW               NUMBER       ,
    INCLUDE_REP_MPS                   NUMBER       ,
    INCLUDE_REQUISITION               NUMBER       ,
    INCLUDE_INTERNAL_REQS             NUMBER       ,
    INCLUDE_VENDOR_REQS               NUMBER       ,
    INCLUDE_INTERNAL_ORDERS           NUMBER       ,
    INCLUDE_FLOW_SCHEDULE_DEMAND      NUMBER       ,
    INCLUDE_FLOW_SCHEDULE_RECEIPTS    NUMBER       ,
    AGGREGATE_TIME_FENCE_CODE         NUMBER       ,
    AGGREGATE_TIME_FENCE              NUMBER       ,
    OBJECT_VERSION_NUMBER             NUMBER(9, 0)     NOT NULL,
    THRESHOLD_VALUE                   NUMBER       ,
    ATP_UOM                           VARCHAR2(80) ,
    REFRESH_NUMBER                    NUMBER(18, 0),
    INCLUDE_PLANNED_DEMAND            NUMBER       ,
    IS_INDIVISIBLE                    NUMBER       ,
    RULE_ID                           NUMBER(18, 0),
    ATP_TIME_FENCE                    NUMBER       ,
    ATP_TIME_FENCE_UD                 NUMBER       ,
    PROFITABLE_TO_PROMISE_CODE        NUMBER       ,
    SUPPLY_CHAIN_SEARCH_CODE          NUMBER       ,
    SEARCH_COMPONENTS_CODE            NUMBER       ,
    INCLUDE_PLANNED_SUPPLY            NUMBER       ,
    LEAD_TIME_CODE                    NUMBER       ,
    LEAD_TIME_TYPE                    NUMBER       ,
    LEAD_TIME_DAYS_UD                 NUMBER       ,
    ALLOCATED_ATP_CODE                NUMBER       ,
    SR_INSTANCE_ID                    NUMBER(18, 0)    NOT NULL,
    RULE_NAME                         VARCHAR2(320)    NOT NULL,
    LAST_UPDATE_DATE                  TIMESTAMP(6)     NOT NULL,
    LAST_UPDATED_BY                   VARCHAR2(256)    NOT NULL,
    CREATION_DATE                     TIMESTAMP(6)     NOT NULL,
    CREATED_BY                        VARCHAR2(256)    NOT NULL,
    LAST_UPDATE_LOGIN                 VARCHAR2(128),
    DESCRIPTION                       VARCHAR2(960),
    PAST_DUE_DEMAND_CUTOFF_FENCE      NUMBER       ,
    PAST_DUE_SUPPLY_CUTOFF_FENCE      NUMBER       ,
    INFINITE_AVAILABLE_CODE           NUMBER       ,
    INFINITE_SUPPLY_FENCE_CODE        NUMBER       ,
    INFINITE_SUPPLY_TIME_FENCE_UD     NUMBER       ,
    ACCEPTABLE_EARLY_FENCE            NUMBER       ,
    ACCEPTABLE_LATE_FENCE             NUMBER       ,
    DEFAULT_ATP_SOURCES               NUMBER       ,
    DEMAND_CLASS_ATP_FLAG             NUMBER       ,
    INCLUDE_SALES_ORDERS              NUMBER           NOT NULL,
    INCLUDE_DISCRETE_WIP_DEMAND       NUMBER       ,
    INCLUDE_DEPENDENT_WIP_DEMAND      NUMBER       ,
    INCLUDE_REP_WIP_DEMAND            NUMBER       ,
    INCLUDE_NONSTD_WIP_DEMAND         NUMBER       ,
    INCLUDE_DISCRETE_MPS              NUMBER       ,
    MPS_DESIGNATOR                    VARCHAR2(40) ,
    INCLUDE_USER_DEFINED_DEMAND       NUMBER           NOT NULL,
    USER_ATP_DEMAND_TABLE_NAME        VARCHAR2(120),
    INCLUDE_PURCHASE_ORDERS           NUMBER           NOT NULL,
    INCLUDE_DISCRETE_WIP_RECEIPTS     NUMBER           NOT NULL,
    INCLUDE_REP_WIP_RECEIPTS          NUMBER           NOT NULL,
    INCLUDE_NONSTD_WIP_RECEIPTS       NUMBER           NOT NULL,
    INCLUDE_INTERORG_TRANSFERS        NUMBER           NOT NULL,
    INCLUDE_ONHAND_AVAILABLE          NUMBER           NOT NULL,
    INCLUDE_USER_DEFINED_SUPPLY       NUMBER           NOT NULL,
    USER_ATP_SUPPLY_TABLE_NAME        VARCHAR2(120),
    ATTRIBUTE_CATEGORY                VARCHAR2(120),
    ATTRIBUTE1                        VARCHAR2(600),
    ATTRIBUTE2                        VARCHAR2(600),
    ATTRIBUTE3                        VARCHAR2(600),
    ATTRIBUTE4                        VARCHAR2(600),
    ATTRIBUTE5                        VARCHAR2(600),
    ATTRIBUTE6                        VARCHAR2(600),
    ATTRIBUTE7                        VARCHAR2(600),
    ATTRIBUTE8                        VARCHAR2(600),
    ATTRIBUTE9                        VARCHAR2(600),
    ATTRIBUTE10                       VARCHAR2(600),
    ATTRIBUTE11                       VARCHAR2(600),
    ATTRIBUTE12                       VARCHAR2(600),
    ATTRIBUTE13                       VARCHAR2(600),
    ATTRIBUTE14                       VARCHAR2(600),
    ATTRIBUTE15                       VARCHAR2(600),
    ACCUMULATION_WINDOW               NUMBER       ,
    INCLUDE_REP_MPS                   NUMBER       ,
    INCLUDE_REQUISITION               NUMBER       ,
    INCLUDE_INTERNAL_REQS             NUMBER       ,
    INCLUDE_VENDOR_REQS               NUMBER       ,
    INCLUDE_INTERNAL_ORDERS           NUMBER       ,
    INCLUDE_FLOW_SCHEDULE_DEMAND      NUMBER       ,
    INCLUDE_FLOW_SCHEDULE_RECEIPTS    NUMBER       ,
    AGGREGATE_TIME_FENCE_CODE         NUMBER       ,
    AGGREGATE_TIME_FENCE              NUMBER       ,
    OBJECT_VERSION_NUMBER             NUMBER(9, 0)     NOT NULL,
    THRESHOLD_VALUE                   NUMBER       ,
    ATP_UOM                           VARCHAR2(80) ,
    REFRESH_NUMBER                    NUMBER(18, 0),
    IS_INDIVISIBLE                    NUMBER       ,
    SPLIT_ORDER_FLAG                  NUMBER(1, 0) ,
    MINIMUM_SPLIT_QUANTITY            NUMBER       ,
    INCLUDE_PLANNED_DEMAND            NUMBER       ,
    CONSTRAINT pk_msc_atp_rules PRIMARY KEY (RULE_ID, RULE_ID)
);
