CREATE OR REPLACE PACKAGE mip_mandatory IS

  -- Author  : HARDYA
  -- Created : 15/11/2007 15:44:36
  -- Purpose : Support Mandatory Field Processing

  -- Public type declarations
  TYPE t_mandatory_check IS RECORD(
     field_name    VARCHAR2(80)
    ,error_message data_item_roles.error_message%TYPE);

  TYPE t_mandatory_checks IS TABLE OF t_mandatory_check INDEX BY BINARY_INTEGER;

  TYPE t_fields IS TABLE OF VARCHAR2(80) INDEX BY BINARY_INTEGER;

  -- Public function and procedure declarations

  PROCEDURE add_error(p_mandatory_checks IN OUT t_mandatory_checks
                     ,p_field_name       IN VARCHAR2
                     ,p_error_message    IN VARCHAR2);

  PROCEDURE add_field(p_fields     IN OUT t_fields
                     ,p_field_name IN VARCHAR2);
END mip_mandatory;
/
CREATE OR REPLACE PACKAGE BODY MIP_MANDATORY IS

  PROCEDURE add_error(p_mandatory_checks IN OUT t_mandatory_checks
                     ,p_field_name       IN VARCHAR2
                     ,p_error_message    IN VARCHAR2) IS
    l_idx NUMBER := p_mandatory_checks.COUNT + 1;
  BEGIN
    p_mandatory_checks(l_idx).field_name := p_field_name;
    p_mandatory_checks(l_idx).error_message := p_error_message;
  END;

  PROCEDURE add_field(p_fields     IN OUT t_fields
                     ,p_field_name IN VARCHAR2) IS
    l_idx NUMBER := p_fields.COUNT + 1;
  BEGIN
    p_fields(l_idx) := p_field_name;
  END add_field;

BEGIN
  -- Initialization
  NULL;
END MIP_MANDATORY;
/
