السبت، 10 فبراير 2018

Script To Rehire An Employee Using Oracle HRMS API

Following script can be used to Rehire an Employee using Oracle HRMS API.

API --  hr_employee_api.re_hire_ex_employee
 
Example -- 
Consider a Ex-Employee we will try to Rehire that employee using Rehire API
  
DECLARE 
     ln_per_object_version_number      PER_ALL_PEOPLE_F.OBJECT_VERSION_NUMBER%TYPE        := 5; 
     ln_assg_object_version_number    PER_ALL_ASSIGNMENTS_F.OBJECT_VERSION_NUMBER%TYPE; 
     ln_assignment_id                               PER_ALL_ASSIGNMENTS_F.ASSIGNMENT_ID%TYPE; 
     ld_per_effective_start_date              PER_ALL_PEOPLE_F.EFFECTIVE_START_DATE%TYPE; 
     ld_per_effective_end_date               PER_ALL_PEOPLE_F.EFFECTIVE_END_DATE%TYPE; 
     ln_assignment_sequence                  PER_ALL_ASSIGNMENTS_F.ASSIGNMENT_SEQUENCE%TYPE; 
     lb_assign_payroll_warning            BOOLEAN; 
     lc_assignment_number                     PER_ALL_ASSIGNMENTS_F.ASSIGNMENT_NUMBER%TYPE;
 
BEGIN     -- Rehire Employee API  
    -- --------------------------------
 
     hr_employee_api.re_hire_ex_employee 
     (    -- Input data elements 
          -- ----------------------------- 
         p_hire_date                                          => TO_DATE('05-MAR-2013'), 
         p_person_id                                         => 32979, 
         p_rehire_reason                                  => NULL, 
         -- Output data elements 
         -- -------------------------------- 
        p_assignment_id                                => ln_assignment_id, 
        p_per_object_version_number       => ln_per_object_version_number, 
        p_asg_object_version_number       => ln_assg_object_version_number, 
        p_per_effective_start_date               => ld_per_effective_start_date, 
        p_per_effective_end_date                => ld_per_effective_end_date, 
        p_assignment_sequence                  => ln_assignment_sequence, 
        p_assignment_number                     => lc_assignment_number, 
        p_assign_payroll_warning             => lb_assign_payroll_warning 
    ); 
  
 COMMIT; 

EXCEPTION        WHEN OTHERS THEN 
                       ROLLBACK; 
                       dbms_output.put_line(SQLERRM); 
END; 

ليست هناك تعليقات:

إرسال تعليق