-- ====================================================================
-- A_TASK_HISTORY_TARGET Table
-- ====================================================================
-- Purpose: Track target data statistics for task history
-- ====================================================================

CREATE TABLE CT_MRDS.A_TASK_HISTORY_TARGET (
    A_TASK_HISTORY_TARGET_KEY NUMBER(38,0) NOT NULL ENABLE,
    A_TASK_HISTORY_KEY NUMBER(38,0),
    TARGET_NAME VARCHAR2(255 BYTE) COLLATE "USING_NLS_COMP",
    ROW_COUNT_APPLIED NUMBER(38,0),
    ROW_COUNT_REJECTED NUMBER(38,0),
    LOAD_STATUS CHAR(1 CHAR) COLLATE "USING_NLS_COMP"
) TABLESPACE "DATA";

-- Comments
COMMENT ON COLUMN CT_MRDS.A_TASK_HISTORY_TARGET.A_TASK_HISTORY_TARGET_KEY IS 'Technical primary key';
COMMENT ON COLUMN CT_MRDS.A_TASK_HISTORY_TARGET.A_TASK_HISTORY_KEY IS 'Foreign key referencing the subprocess delivering to the target';
COMMENT ON COLUMN CT_MRDS.A_TASK_HISTORY_TARGET.TARGET_NAME IS 'Name of the DWH target table written in the load process';
COMMENT ON COLUMN CT_MRDS.A_TASK_HISTORY_TARGET.ROW_COUNT_APPLIED IS 'Number of rows succesfully applied (written to) the DWH target table during the load process';
COMMENT ON COLUMN CT_MRDS.A_TASK_HISTORY_TARGET.ROW_COUNT_REJECTED IS 'Number of rows rejected (NOT written to) the DWH target table during the load process';
COMMENT ON COLUMN CT_MRDS.A_TASK_HISTORY_TARGET.LOAD_STATUS IS 'Allowed values are RUNNING, SUCCESS and FAILED.';