--
declare
--
l_action varchar2(10) := 'CREATE';--'UPDATE'
--
--- DECLARE variables for hr_assignment_extra_info_api
--- IN variables
l_assignment_id number := 123456;
l_info_type per_assignment_extra_info.information_type%type := 'XXAK_COM_EXTRA';
l_aei_info_cat per_assignment_extra_info.aei_information_category%type := 'XXAK_COM_EXTRA';
l_aei_info1 per_assignment_extra_info.aei_information1%type := 'Bonus';
l_emp_max_bonus varchar2(30) := '16';
l_ass_extra_info_id number;
--- OUT variables
l_obj_version_number number;
--
begin
/*
* This API creates an Assignment Extra Information record for a given
* assignment.
* @param p_information_type Identifies the Assignment Extra Information Type.
* Must be active.
*/
if l_action = 'CREATE' then
--
l_ass_extra_info_id := null;
--
hr_assignment_extra_info_api.create_assignment_extra_info
( p_validate => false
, p_assignment_id => l_assignment_id
, p_information_type => l_info_type
, p_aei_information_category => l_aei_info_cat
, p_aei_information1 => l_aei_info1
, p_aei_information2 => l_emp_max_bonus
, p_aei_information3 => to_char(sysdate,'YYYY/MM/DD HH24:MI:SS')
-- Out
, p_assignment_extra_info_id => l_ass_extra_info_id
, p_object_version_number => l_obj_version_number
);
if l_obj_version_number is null then
dbms_output.put_line('Assignment Attribute creation failed '||sqlerrm);
rollback;
else
dbms_output.put_line('Assignment Attribute created');
commit;
end if;
else
--
l_obj_version_number := 3;
l_ass_extra_info_id := 345612;
--
hr_assignment_extra_info_api.update_assignment_extra_info
( p_validate => false
, p_assignment_extra_info_id => l_ass_extra_info_id
-- In / Out
, p_object_version_number => l_obj_version_number
-- In
, p_aei_information_category => l_aei_info_cat
, p_aei_information1 => l_aei_info1
, p_aei_information2 => l_emp_max_bonus
, p_aei_information3 => to_char(sysdate,'YYYY/MM/DD HH24:MI:SS')
);
if l_obj_version_number > 3 then
dbms_output.put_line('Assignment Attribute updated');
commit;
else
dbms_output.put_line('Assignment Attribute updation failed '||sqlerrm);
rollback;
end if;
end if;
--
exception
when others then
dbms_output.put_line('pqp_aat_api API failed with error :'||sqlerrm);
rollback;
end;
--
declare
--
l_action varchar2(10) := 'CREATE';--'UPDATE'
--
--- DECLARE variables for hr_assignment_extra_info_api
--- IN variables
l_assignment_id number := 123456;
l_info_type per_assignment_extra_info.information_type%type := 'XXAK_COM_EXTRA';
l_aei_info_cat per_assignment_extra_info.aei_information_category%type := 'XXAK_COM_EXTRA';
l_aei_info1 per_assignment_extra_info.aei_information1%type := 'Bonus';
l_emp_max_bonus varchar2(30) := '16';
l_ass_extra_info_id number;
--- OUT variables
l_obj_version_number number;
--
begin
/*
* This API creates an Assignment Extra Information record for a given
* assignment.
* @param p_information_type Identifies the Assignment Extra Information Type.
* Must be active.
*/
if l_action = 'CREATE' then
--
l_ass_extra_info_id := null;
--
hr_assignment_extra_info_api.create_assignment_extra_info
( p_validate => false
, p_assignment_id => l_assignment_id
, p_information_type => l_info_type
, p_aei_information_category => l_aei_info_cat
, p_aei_information1 => l_aei_info1
, p_aei_information2 => l_emp_max_bonus
, p_aei_information3 => to_char(sysdate,'YYYY/MM/DD HH24:MI:SS')
-- Out
, p_assignment_extra_info_id => l_ass_extra_info_id
, p_object_version_number => l_obj_version_number
);
if l_obj_version_number is null then
dbms_output.put_line('Assignment Attribute creation failed '||sqlerrm);
rollback;
else
dbms_output.put_line('Assignment Attribute created');
commit;
end if;
else
--
l_obj_version_number := 3;
l_ass_extra_info_id := 345612;
--
hr_assignment_extra_info_api.update_assignment_extra_info
( p_validate => false
, p_assignment_extra_info_id => l_ass_extra_info_id
-- In / Out
, p_object_version_number => l_obj_version_number
-- In
, p_aei_information_category => l_aei_info_cat
, p_aei_information1 => l_aei_info1
, p_aei_information2 => l_emp_max_bonus
, p_aei_information3 => to_char(sysdate,'YYYY/MM/DD HH24:MI:SS')
);
if l_obj_version_number > 3 then
dbms_output.put_line('Assignment Attribute updated');
commit;
else
dbms_output.put_line('Assignment Attribute updation failed '||sqlerrm);
rollback;
end if;
end if;
--
exception
when others then
dbms_output.put_line('pqp_aat_api API failed with error :'||sqlerrm);
rollback;
end;
--
No comments:
Post a Comment