--
declare
--
l_action varchar2(10) := 'CREATE';--'UPDATE'
--
--- DECLARE variables for pqp_aat_api
--- IN variables
l_assignment_id number := 123456;
l_business_group_id number := 101;
l_contract_type pqp_assignment_attributes_f.contract_type%type := 'Contractual 37 hours';
--- OUT variables
l_attr_ass_id number;
l_effective_start_date date;
l_effective_end_date date;
l_obj_version_number number;
--
begin
/*
* This API is used to create assignment attributes. These attributes
* include contract type and details of work patterns that are mainly used by
* public sector. Note: even though there are columns for vehicle information,
* these are not used anymore as the new api's pqp_vehicle_repository_api and
* pqp_vehicle_allocation_api are used for vehicle repository and allocations
* respectively.
*/
if l_action = 'CREATE' then
--
l_attr_ass_id := null;
--
pqp_aat_api.create_assignment_attribute
( p_validate => false
, p_effective_date => trunc(sysdate)
, p_business_group_id => l_business_group_id
, p_assignment_id => l_assignment_id
, p_contract_type => l_contract_type
-- Out
, p_effective_start_date => l_effective_start_date
, p_effective_end_date => l_effective_end_date
, p_assignment_attribute_id => l_attr_ass_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_attr_ass_id := 345612;
--
pqp_aat_api.update_assignment_attribute
( p_validate => false
, p_effective_date => trunc(sysdate)
, p_datetrack_mode => 'CORRECTION'
, p_assignment_attribute_id => l_attr_ass_id
, p_business_group_id => l_business_group_id
, p_assignment_id => l_assignment_id
, p_contract_type => l_contract_type
-- Out
, p_effective_start_date => l_effective_start_date
, p_effective_end_date => l_effective_end_date
-- In / Out
, p_object_version_number => l_obj_version_number
);
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 pqp_aat_api
--- IN variables
l_assignment_id number := 123456;
l_business_group_id number := 101;
l_contract_type pqp_assignment_attributes_f.contract_type%type := 'Contractual 37 hours';
--- OUT variables
l_attr_ass_id number;
l_effective_start_date date;
l_effective_end_date date;
l_obj_version_number number;
--
begin
/*
* This API is used to create assignment attributes. These attributes
* include contract type and details of work patterns that are mainly used by
* public sector. Note: even though there are columns for vehicle information,
* these are not used anymore as the new api's pqp_vehicle_repository_api and
* pqp_vehicle_allocation_api are used for vehicle repository and allocations
* respectively.
*/
if l_action = 'CREATE' then
--
l_attr_ass_id := null;
--
pqp_aat_api.create_assignment_attribute
( p_validate => false
, p_effective_date => trunc(sysdate)
, p_business_group_id => l_business_group_id
, p_assignment_id => l_assignment_id
, p_contract_type => l_contract_type
-- Out
, p_effective_start_date => l_effective_start_date
, p_effective_end_date => l_effective_end_date
, p_assignment_attribute_id => l_attr_ass_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_attr_ass_id := 345612;
--
pqp_aat_api.update_assignment_attribute
( p_validate => false
, p_effective_date => trunc(sysdate)
, p_datetrack_mode => 'CORRECTION'
, p_assignment_attribute_id => l_attr_ass_id
, p_business_group_id => l_business_group_id
, p_assignment_id => l_assignment_id
, p_contract_type => l_contract_type
-- Out
, p_effective_start_date => l_effective_start_date
, p_effective_end_date => l_effective_end_date
-- In / Out
, p_object_version_number => l_obj_version_number
);
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