--
declare
--
l_validate boolean := false;
--- DECLARE variables for hr_contingent_worker_api.create_cwk
--- IN variables
l_hire_date per_all_people_f.start_date%type := trunc(sysdate);
l_last_name per_all_people_f.last_name%type := 'Kumar';
l_first_name per_all_people_f.first_name%type := 'Abhay';
l_middle_names per_all_people_f.middle_names%type ;
l_sex per_all_people_f.sex%type := 'M';
l_known_as per_all_people_f.known_as%type ;
l_date_of_birth per_all_people_f.date_of_birth%type := to_date('11/11/1999','DD/MM/YYYY');
--hr_lookups--'MARITAL_STATUS'
l_marital_status per_all_people_f.marital_status%type := 'S';
l_ni_number per_all_people_f.national_identifier%type := 123456;
--hr_lookups--'TITLE'
l_title per_all_people_f.title%type := 'MR.';
l_email per_all_people_f.email%type := 'testadd@abhayappssolution.com';
--hr_lookups--'NATIONALITY'
l_nationality per_all_people_f.nationality%type := 'IN';
l_employee_number per_all_people_f.employee_number%type := 567890;
l_director varchar2(1) default 'N';
l_ni_multiple_asg varchar2(1) default 'N';
l_pensioner varchar2(1);
l_business_group_id per_business_groups.business_group_id%type := 101;
l_person_type_id per_person_types.person_type_id%type := 1126;
--- OUT variables
l_person_id number default null;
l_assignment_id number default null;
l_per_object_version_number number;
l_pdp_object_version_number number;
l_asg_object_version_number number;
l_per_effective_start_date date;
l_per_effective_end_date date;
l_full_name varchar2(300);
l_comment_id number;
l_assignment_sequence number;
l_assignment_number varchar2(10);
l_name_combination_warning boolean := false;
--
begin
--
hr_contingent_worker_api.create_cwk (
p_validate => l_validate --in boolean default false
,p_start_date => l_hire_date --in date
,p_business_group_id => l_business_group_id --in number
,p_last_name => l_last_name --in varchar2
,p_person_type_id => l_person_type_id --in number default null
,p_npw_number => l_employee_number --in out nocopy varchar2
,p_background_check_status => NULL --in varchar2 default null
,p_background_date_check => NULL --in date default null
,p_blood_type => NULL --in varchar2 default null
,p_comments => NULL --in varchar2 default null
,p_correspondence_language => NULL --in varchar2 default null
,p_country_of_birth => NULL --in varchar2 default null
,p_date_of_birth => l_date_of_birth --in date default null
,p_date_of_death => NULL --in date default null
,p_dpdnt_adoption_date => NULL --in date default null
,p_dpdnt_vlntry_svce_flag => NULL --in varchar2 default null
,p_email_address => l_email --in varchar2 default null
,p_first_name => l_first_name --in varchar2 default null
,p_fte_capacity => NULL --in number default null
,p_honors => NULL --in varchar2 default null
,p_internal_location => NULL --in varchar2 default null
,p_known_as => l_known_as --in varchar2 default null
,p_last_medical_test_by => NULL --in varchar2 default null
,p_last_medical_test_date => NULL --in date default null
,p_mailstop => NULL --in varchar2 default null
,p_marital_status => l_marital_status --in varchar2 default null
,p_middle_names => l_middle_names --in varchar2 default null
,p_national_identifier => l_ni_number --in varchar2 default null
,p_nationality => l_nationality --in varchar2 default null
,p_office_number => NULL --in varchar2 default null
,p_on_military_service => NULL --in varchar2 default null
,p_party_id => NULL --in number default null
,p_pre_name_adjunct => NULL --in varchar2 default null
,p_previous_last_name => NULL --in varchar2 default null
,p_projected_placement_end => NULL --in date default null
,p_receipt_of_death_cert_date => NULL --in date default null
,p_region_of_birth => NULL --in varchar2 default null
,p_registered_disabled_flag => NULL --in varchar2 default null
,p_resume_exists => NULL --in varchar2 default null
,p_resume_last_updated => NULL --in date default null
,p_second_passport_exists => NULL --in varchar2 default null
,p_sex => l_sex --in varchar2 default null
,p_student_status => NULL --in varchar2 default null
,p_suffix => NULL --in varchar2 default null
,p_title => l_title --in varchar2 default null
,p_town_of_birth => NULL --in varchar2 default null
,p_uses_tobacco_flag => NULL --in varchar2 default null
,p_vendor_id => NULL --in number default null
,p_work_schedule => NULL --in varchar2 default null
,p_work_telephone => NULL --in varchar2 default null
,p_exp_check_send_to_address => NULL --in varchar2 default null
,p_hold_applicant_date_until => NULL --in date default null
,p_date_employee_data_verified => NULL --in date default null
,p_benefit_group_id => NULL --in number default null
,p_coord_ben_med_pln_no => NULL --in varchar2 default null
,p_coord_ben_no_cvg_flag => NULL --in varchar2 default null
,p_original_date_of_hire => NULL --in date default null
,p_attribute_category => NULL
,p_attribute1 =>'ATTR1VAL'
,p_attribute2 => 'ATTR2VAL'
-- p_per_information_category - Obsolete parameter, do not use
,p_per_information1 => NULL --in varchar2 default null
---
,p_per_information30 => NULL --in varchar2 default null
--Out Variables
,p_person_id => l_person_id
,p_per_object_version_number => l_per_object_version_number
,p_per_effective_start_date => l_per_effective_start_date
,p_per_effective_end_date => l_per_effective_end_date
,p_pdp_object_version_number => l_pdp_object_version_number
,p_full_name => l_full_name
,p_comment_id => l_comment_id
,p_assignment_id => l_assignment_id
,p_asg_object_version_number => l_asg_object_version_number
,p_assignment_sequence => l_assignment_sequence
,p_assignment_number => l_assignment_number
,p_name_combination_warning => l_name_combination_warning
);
--
if l_name_combination_warning then
dbms_output.put_line('Warning validating API: hr_contingent_worker_api.create_cwk');
rollback;
else
dbms_output.put_line('Contingent Worker Created: ');
commit;
end if;
--
exception
when others then
dbms_output.put_line('Error: '||sqlerrm);
rollback;
end;
--
declare
--
l_validate boolean := false;
--- DECLARE variables for hr_contingent_worker_api.create_cwk
--- IN variables
l_hire_date per_all_people_f.start_date%type := trunc(sysdate);
l_last_name per_all_people_f.last_name%type := 'Kumar';
l_first_name per_all_people_f.first_name%type := 'Abhay';
l_middle_names per_all_people_f.middle_names%type ;
l_sex per_all_people_f.sex%type := 'M';
l_known_as per_all_people_f.known_as%type ;
l_date_of_birth per_all_people_f.date_of_birth%type := to_date('11/11/1999','DD/MM/YYYY');
--hr_lookups--'MARITAL_STATUS'
l_marital_status per_all_people_f.marital_status%type := 'S';
l_ni_number per_all_people_f.national_identifier%type := 123456;
--hr_lookups--'TITLE'
l_title per_all_people_f.title%type := 'MR.';
l_email per_all_people_f.email%type := 'testadd@abhayappssolution.com';
--hr_lookups--'NATIONALITY'
l_nationality per_all_people_f.nationality%type := 'IN';
l_employee_number per_all_people_f.employee_number%type := 567890;
l_director varchar2(1) default 'N';
l_ni_multiple_asg varchar2(1) default 'N';
l_pensioner varchar2(1);
l_business_group_id per_business_groups.business_group_id%type := 101;
l_person_type_id per_person_types.person_type_id%type := 1126;
--- OUT variables
l_person_id number default null;
l_assignment_id number default null;
l_per_object_version_number number;
l_pdp_object_version_number number;
l_asg_object_version_number number;
l_per_effective_start_date date;
l_per_effective_end_date date;
l_full_name varchar2(300);
l_comment_id number;
l_assignment_sequence number;
l_assignment_number varchar2(10);
l_name_combination_warning boolean := false;
--
begin
--
hr_contingent_worker_api.create_cwk (
p_validate => l_validate --in boolean default false
,p_start_date => l_hire_date --in date
,p_business_group_id => l_business_group_id --in number
,p_last_name => l_last_name --in varchar2
,p_person_type_id => l_person_type_id --in number default null
,p_npw_number => l_employee_number --in out nocopy varchar2
,p_background_check_status => NULL --in varchar2 default null
,p_background_date_check => NULL --in date default null
,p_blood_type => NULL --in varchar2 default null
,p_comments => NULL --in varchar2 default null
,p_correspondence_language => NULL --in varchar2 default null
,p_country_of_birth => NULL --in varchar2 default null
,p_date_of_birth => l_date_of_birth --in date default null
,p_date_of_death => NULL --in date default null
,p_dpdnt_adoption_date => NULL --in date default null
,p_dpdnt_vlntry_svce_flag => NULL --in varchar2 default null
,p_email_address => l_email --in varchar2 default null
,p_first_name => l_first_name --in varchar2 default null
,p_fte_capacity => NULL --in number default null
,p_honors => NULL --in varchar2 default null
,p_internal_location => NULL --in varchar2 default null
,p_known_as => l_known_as --in varchar2 default null
,p_last_medical_test_by => NULL --in varchar2 default null
,p_last_medical_test_date => NULL --in date default null
,p_mailstop => NULL --in varchar2 default null
,p_marital_status => l_marital_status --in varchar2 default null
,p_middle_names => l_middle_names --in varchar2 default null
,p_national_identifier => l_ni_number --in varchar2 default null
,p_nationality => l_nationality --in varchar2 default null
,p_office_number => NULL --in varchar2 default null
,p_on_military_service => NULL --in varchar2 default null
,p_party_id => NULL --in number default null
,p_pre_name_adjunct => NULL --in varchar2 default null
,p_previous_last_name => NULL --in varchar2 default null
,p_projected_placement_end => NULL --in date default null
,p_receipt_of_death_cert_date => NULL --in date default null
,p_region_of_birth => NULL --in varchar2 default null
,p_registered_disabled_flag => NULL --in varchar2 default null
,p_resume_exists => NULL --in varchar2 default null
,p_resume_last_updated => NULL --in date default null
,p_second_passport_exists => NULL --in varchar2 default null
,p_sex => l_sex --in varchar2 default null
,p_student_status => NULL --in varchar2 default null
,p_suffix => NULL --in varchar2 default null
,p_title => l_title --in varchar2 default null
,p_town_of_birth => NULL --in varchar2 default null
,p_uses_tobacco_flag => NULL --in varchar2 default null
,p_vendor_id => NULL --in number default null
,p_work_schedule => NULL --in varchar2 default null
,p_work_telephone => NULL --in varchar2 default null
,p_exp_check_send_to_address => NULL --in varchar2 default null
,p_hold_applicant_date_until => NULL --in date default null
,p_date_employee_data_verified => NULL --in date default null
,p_benefit_group_id => NULL --in number default null
,p_coord_ben_med_pln_no => NULL --in varchar2 default null
,p_coord_ben_no_cvg_flag => NULL --in varchar2 default null
,p_original_date_of_hire => NULL --in date default null
,p_attribute_category => NULL
,p_attribute1 =>'ATTR1VAL'
,p_attribute2 => 'ATTR2VAL'
-- p_per_information_category - Obsolete parameter, do not use
,p_per_information1 => NULL --in varchar2 default null
---
,p_per_information30 => NULL --in varchar2 default null
--Out Variables
,p_person_id => l_person_id
,p_per_object_version_number => l_per_object_version_number
,p_per_effective_start_date => l_per_effective_start_date
,p_per_effective_end_date => l_per_effective_end_date
,p_pdp_object_version_number => l_pdp_object_version_number
,p_full_name => l_full_name
,p_comment_id => l_comment_id
,p_assignment_id => l_assignment_id
,p_asg_object_version_number => l_asg_object_version_number
,p_assignment_sequence => l_assignment_sequence
,p_assignment_number => l_assignment_number
,p_name_combination_warning => l_name_combination_warning
);
--
if l_name_combination_warning then
dbms_output.put_line('Warning validating API: hr_contingent_worker_api.create_cwk');
rollback;
else
dbms_output.put_line('Contingent Worker Created: ');
commit;
end if;
--
exception
when others then
dbms_output.put_line('Error: '||sqlerrm);
rollback;
end;
--
This is very helpful. Thanks, Sri
ReplyDeleteError: ORA-20001: You cannot create a Contingent Worker. You need to set up your business group information to determine how to generate the Contingent Worker number. i am getting this error
ReplyDeleteError: ORA-20001: You cannot create a Contingent Worker. You need to set up your business group information to determine how to generate the Contingent Worker number.
ReplyDeleteany suggestions
ReplyDelete