Infolinks

Friday 6 July 2012

HR CREATE NEW PROFILE

HR CREATE NEW EMPLOYEE

 DECLARE
  x_emp_num VARCHAR2(200) := null ;
  x_business_group_id NUMBER:=202;
 -- x_person_type_id    NUMBER:=13;
  x_validate_mode     BOOLEAN := FALSE; 
  x_person_id NUMBER ;
  x_assignment_id NUMBER ;
  x_per_object_version_number NUMBER;
  x_asg_object_version_number NUMBER;
  x_per_effective_start_date  DATE;
  x_per_effective_end_date    DATE;
  x_full_name                 VARCHAR2(300);
  x_per_comment_id            NUMBER;
  x_assignment_sequence       NUMBER;
  x_assignment_number         VARCHAR2(10);
  x_name_combination_warning  BOOLEAN := FALSE;
  x_assign_payroll_warning    BOOLEAN := FALSE;
  x_orig_hire_warning         BOOLEAN := FALSE;
BEGIN
  /*SELECT business_group_id
  INTO x_business_group_id
  FROM per_business_groups
  WHERE NAME = 'Vision Corporation';
  SELECT ppt.person_type_id
  INTO x_person_type_id
  FROM per_person_types ppt
  WHERE ppt.business_group_id = x_business_group_id
  AND ppt.user_person_type = 'Employee';*/
DBMS_OUTPUT.PUT_LINE('*** BEFORE CALLING ***');
 hr_employee_api.create_gb_employee(p_validate                  => x_validate_mode
                                    ,p_hire_date                 => SYSDATE -- In this case
                                    ,p_business_group_id         => x_business_group_id
                                    ,p_last_name                 => 'Suresh'
                                    ,p_sex                       => 'M'
                                   -- ,p_person_type_id            => x_person_type_id
                                    ,p_date_of_birth             => '12-JAN-83'
                                    ,p_employee_number           => x_emp_num
                                    ,p_first_name                => 'AQEELUDDIN'
                                    ,p_known_as                  => ''
                                    ,p_marital_status            => ''
                                    ,p_middle_names              => ''
                                    ,p_ni_number                 => '958643218'
                                    ,p_previous_last_name        => ''
                                    ,p_title                     => 'MR.'
                                    ,p_original_date_of_hire     => SYSDATE
                                    ,p_person_id                 => x_person_id
                                    ,p_assignment_id             => x_assignment_id
                                    ,p_per_object_version_number => x_per_object_version_number
                                    ,p_asg_object_version_number => x_asg_object_version_number
                                    ,p_per_effective_start_date  => x_per_effective_start_date
                                    ,p_per_effective_end_date    => x_per_effective_end_date
                                    ,p_full_name                 => x_full_name
                                    ,p_per_comment_id            => x_per_comment_id
                                    ,p_assignment_sequence       => x_assignment_sequence
                                    ,p_assignment_number         => x_assignment_number
                                    ,p_name_combination_warning  => x_name_combination_warning
                                    ,p_assign_payroll_warning    => x_assign_payroll_warning
                                    ,p_orig_hire_warning         => x_orig_hire_warning
                                    );
COMMIT ;
IF(x_person_id=NULL) THEN
DBMS_OUTPUT.PUT_LINE('*** GOT ERROR ***');
END IF;
EXCEPTION WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('ERROR '||SQLERRM);
END;

No comments:

Post a Comment