Saturday, September 6, 2014

Create Position Structure Version (per_pos_structure_version_api.create_pos_structure_version)

CREATE OR REPLACE PROCEDURE xx_upload_pos_structure_ver
AS
   --Step 2 Create New Hierarchy Version PER_POS_STRUCTURE_VERSION_API.CREATE_POS_STRUCTURE_VERSION
   l_effective_date             DATE;
   l_position_structure_id      NUMBER;
   l_date_from                  DATE;

   l_version_number             NUMBER;
   v_pos_structure_version_id   NUMBER;
   v_object_version_number      NUMBER;
   v_gap_warning                BOOLEAN;
BEGIN
   l_effective_date := '01-jan-2006';
   l_date_from := '01-jan-2006';
   BEGIN
      SELECT position_structure_id, object_version_number
        INTO l_position_structure_id, l_version_number
        FROM per_position_structures
       WHERE NAME = 'Etisalat HR Postion Hierarchy';
   EXCEPTION
      WHEN OTHERS
      THEN
         NULL;
   END;
   per_pos_structure_version_api.create_pos_structure_version
                    (p_effective_date                => l_effective_date,
                     p_position_structure_id         => l_position_structure_id,
                     p_date_from                     => l_date_from,
                     p_version_number                => l_version_number,
                     p_pos_structure_version_id      => v_pos_structure_version_id,
                     p_object_version_number         => v_object_version_number,
                     p_gap_warning                   => v_gap_warning
                    );
END;