You are on page 1of 2

HRMS

Following script can be used to create or update and Employee phone number using oracle HRMS API.
API -- hr_phone_api.create_or_update_phone Example -DECLARE ln_phone_id PER_PHONES.PHONE_ID%TYPE; ln_object_version_number PER_PHONES.OBJECT_VERSION_NUMBER%TYPE; BEGIN -- Create or Update Employee Phone Detail -- ----------------------------------------------------------- hr_phone_api.create_or_update_phone ( -- Input data elements -- ----------------------------- p_date_from => TO_DATE('13-JUN-2011'), p_phone_type => 'W1', p_phone_number => '9999999', p_parent_id => 32979, p_parent_table => 'PER_ALL_PEOPLE_F', p_effective_date => TO_DATE('12-MAR-2013'), -- Output data elements -- -------------------------------- p_phone_id => ln_phone_id, p_object_version_number => ln_object_version_number ); COMMIT; EXCEPTION WHEN OTHERS THEN ROLLBACK; dbms_output.put_line(SQLERRM); END; / SHOW ERR;

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; / SHOW ERR;