Nov 10, 2010

HR EMPLOYEE API to CREATE EMPLOYEE in HRMS....

DECLARE
   l_emp_num varchar2(20);
   l_person_id number;
   l_assignment_id number;
   l_asg_object_version_number number;
   l_effective_start_date date;
   l_effective_end_date date;
   l_full_name varchar2(240);
   l_per_comment_id number;
   l_assignment_sequence number;
   l_assignment_number per_all_assignments_f.assignment_number%TYPE;
   l_name_combination_warning boolean;
   l_assign_payroll_warning boolean;
   l_orig_hire_warning boolean;
   l_per_object_version_number number;
   l_asgobject_version_number number;
   l_comment_id number(5);
  CURSOR CUR_TP IS
 SELECT     tp.hire_date
    ,tp.business_group_id
    ,tp.last_name
      ,tp.sex
 FROM TEMP_PERSON tp ;
BEGIN
   for ap in CUR_TP loop
   l_emp_num:=null;
   begin
   HR_EMPLOYEE_API.CREATE_EMPLOYEE
   (
   p_hire_date                     =>    ap.hire_date
  ,p_business_group_id             =>    ap.business_group_id
  ,p_last_name                     =>    ap.last_name
  ,p_sex                           =>    ap.sex
  ,p_employee_number     =>  l_emp_num
  ,p_person_id       =>  l_person_id
  ,p_assignment_id       =>   l_assignment_id
  ,p_per_object_version_number     =>    l_per_object_version_number
  ,p_asg_object_version_number     =>    l_asgobject_version_number
  ,p_per_effective_start_date      =>    l_effective_start_date
  ,p_per_effective_end_date        =>    l_effective_end_date
  ,p_full_name                     =>    l_full_name
  ,p_per_comment_id            =>  l_comment_id
  ,p_assignment_sequence     =>  l_assignment_sequence
  ,p_assignment_number     =>  l_assignment_number
  ,p_name_combination_warning      =>  l_name_combination_warning
  ,p_assign_payroll_warning    =>  l_assign_payroll_warning
  ,p_orig_hire_warning     =>  l_orig_hire_warning
   );
end;
 END LOOP;
  COMMIT;
 END;
/


   hr_utility.set_message(801, 'HR_7208_API_BUS_GRP_INVALID');
   hr_utility.raise_error;

2 comments:

Leonardo said...

I'm having trouble using this API. The following error occurs:

ORA-00904: "HR_GENERAL". "DECODE_LOOKUP": invalid identifier

How can I resolve this error?

Unknown said...

ORA-00904 string: invalid identifier

Cause: The column name entered is either missing or invalid.

Action: Enter a valid column name. A valid column name must begin with a letter, be less than or equal to 30 characters, and consist of only alphanumeric characters and the special characters $, _, and #.

If it contains other characters, then it must be enclosed in double quotation marks. It may not be a reserved word.
To avoid ORA-00904, column names cannot be a reserved word, and must contain these four criteria to be valid:

begin with a letter
be less than or equal to thirty characters
consist only of alphanumeric and the special characters ($_#); other characters need double quotation marks around them
Another important factor in correcting ORA-00904 is remembering to run catproc.sql

You can also check your trace file to find the particular error which is causing the ORA-00904 to occur.

OraApps Search

Custom Search

Search This Blog