The following lines contain the word 'select', 'insert', 'update' or 'delete':
select distinct assignment_id
into l_asg_id
from pay_element_entries_f
where element_entry_id = p_entry_id;
g_entry_list.entry_id.delete;
g_entry_list.high_value.delete;
g_entry_list.low_value.delete;
g_entry_list.high_value_result.delete;
g_entry_list.low_value_result.delete;
g_entry_list.guess_value.delete;
g_entry_list.target_value.delete;
g_entry_list.inter_mode.delete;
g_entry_list.entry_id.delete;
g_entry_list.high_value.delete;
g_entry_list.low_value.delete;
g_entry_list.high_value_result.delete;
g_entry_list.low_value_result.delete;
g_entry_list.guess_value.delete;
g_entry_list.target_value.delete;
g_entry_list.inter_mode.delete;
g_entry_list.entry_id.delete;
g_entry_list.high_value.delete;
g_entry_list.low_value.delete;
g_entry_list.high_value_result.delete;
g_entry_list.low_value_result.delete;
g_entry_list.guess_value.delete;
g_entry_list.target_value.delete;
g_entry_list.inter_mode.delete;
g_entry_list.entry_id.delete;
g_entry_list.high_value.delete;
g_entry_list.low_value.delete;
g_entry_list.high_value_result.delete;
g_entry_list.low_value_result.delete;
g_entry_list.guess_value.delete;
g_entry_list.target_value.delete;
g_entry_list.inter_mode.delete;
select legislation_code
into l_leg_code
from per_business_groups_perf
where business_group_id = p_bg_id;
select run_type_id
, run_type_name
, shortname
, srs_flag
, run_information_category
, run_information1
, run_information2
, run_information3
, run_information4
, run_information5
, run_information6
, run_information7
, run_information8
, run_information9
, run_information10
, run_information11
, run_information12
, run_information13
, run_information14
, run_information15
, run_information16
, run_information17
, run_information18
, run_information19
, run_information20
, run_information21
, run_information22
, run_information23
, run_information24
, run_information25
, run_information26
, run_information27
, run_information28
, run_information29
, run_information30
, legislation_code
, business_group_id
, effective_start_date
, effective_end_date
, object_version_number
from pay_run_types_f
where run_type_name = p_rt_name
and business_group_id = (select pbg.business_group_id
from per_business_groups pbg
where upper(pbg.name) = upper(p_business_group))
and legislation_code is null;
select run_type_id
, run_type_name
, shortname
, srs_flag
, run_information_category
, run_information1
, run_information2
, run_information3
, run_information4
, run_information5
, run_information6
, run_information7
, run_information8
, run_information9
, run_information10
, run_information11
, run_information12
, run_information13
, run_information14
, run_information15
, run_information16
, run_information17
, run_information18
, run_information19
, run_information20
, run_information21
, run_information22
, run_information23
, run_information24
, run_information25
, run_information26
, run_information27
, run_information28
, run_information29
, run_information30
, legislation_code
, business_group_id
, effective_start_date
, effective_end_date
, object_version_number
from pay_run_types_f
where run_type_name = p_rt_name
and legislation_code = p_legislative_code
and business_group_id is null;
select run_type_id
, run_type_name
, shortname
, srs_flag
, run_information_category
, run_information1
, run_information2
, run_information3
, run_information4
, run_information5
, run_information6
, run_information7
, run_information8
, run_information9
, run_information10
, run_information11
, run_information12
, run_information13
, run_information14
, run_information15
, run_information16
, run_information17
, run_information18
, run_information19
, run_information20
, run_information21
, run_information22
, run_information23
, run_information24
, run_information25
, run_information26
, run_information27
, run_information28
, run_information29
, run_information30
, legislation_code
, business_group_id
, effective_start_date
, effective_end_date
, object_version_number
from pay_run_types_f prt
where run_type_name = p_rt_name
and business_group_id is null
and legislation_code is null;
select business_group_id
from per_business_groups
where upper(name) = upper(p_business_group);
procedure insert_row is
--
begin
--
hr_startup_data_api_support.enable_startup_mode(l_mode);
hr_startup_data_api_support.delete_owner_definitions;
select run_type_id
, run_type_name
, shortname
, srs_flag
, run_information_category
, run_information1
, run_information2
, run_information3
, run_information4
, run_information5
, run_information6
, run_information7
, run_information8
, run_information9
, run_information10
, run_information11
, run_information12
, run_information13
, run_information14
, run_information15
, run_information16
, run_information17
, run_information18
, run_information19
, run_information20
, run_information21
, run_information22
, run_information23
, run_information24
, run_information25
, run_information26
, run_information27
, run_information28
, run_information29
, run_information30
, legislation_code
, business_group_id
, effective_start_date
, effective_end_date
, object_version_number
, l_mode
into rec_uploaded
from pay_run_types_f
where run_type_id = l_out_rt_id;
end insert_row;
procedure zap_insert(p_rt_id number) is
--
cursor chk_for_children
is
select run_type_usage_id
, object_version_number
, business_group_id
, legislation_code
, effective_start_date
from pay_run_type_usages_f
where parent_run_type_id = l_rt_id;
select 1
from pay_run_types_f_tl
where run_type_id = l_rt_id;
select product_short_name
from hr_owner_definitions
where session_id = p_sess;
select l.language_code
from fnd_languages l
where l.installed_flag in ('I','B')
and exists (select null
from pay_run_types_f_tl rtt
where rtt.run_type_id = p_rt_id
and rtt.language = l.language_code);
hr_startup_data_api_support.delete_owner_definitions;
delete from pay_run_types_f
where run_type_id = p_rt_id;
delete from pay_run_types_f_tl
where run_type_id = p_rt_id
and language = each_row.language_code;
delete from hr_application_ownerships
where key_name = 'RUN_TYPE_ID'
and key_value = p_rt_id
and product_name = each_row.product_short_name;
select run_type_id
, run_type_name
, shortname
, srs_flag
, run_information_category
, run_information1
, run_information2
, run_information3
, run_information4
, run_information5
, run_information6
, run_information7
, run_information8
, run_information9
, run_information10
, run_information11
, run_information12
, run_information13
, run_information14
, run_information15
, run_information16
, run_information17
, run_information18
, run_information19
, run_information20
, run_information21
, run_information22
, run_information23
, run_information24
, run_information25
, run_information26
, run_information27
, run_information28
, run_information29
, run_information30
, legislation_code
, business_group_id
, effective_start_date
, effective_end_date
, object_version_number
, l_mode
into rec_uploaded
from pay_run_types_f
where run_type_id = l_out_rt_id;
end zap_insert;
procedure update_row is
--
begin
--
hr_startup_data_api_support.enable_startup_mode(l_mode);
hr_startup_data_api_support.delete_owner_definitions;
pay_run_type_api.update_run_type
(p_effective_date => p_effective_start_date
,p_datetrack_update_mode => 'UPDATE'
,p_run_type_id => rec_uploaded.rt_id
,p_object_version_number => rec_uploaded.rt_ovn
,p_business_group_id => l_bg
,p_legislation_code => p_legislative_code
,p_shortname => p_shortname
,p_srs_flag => p_srs_flag
,p_run_information_category => p_run_information_category
,p_run_information1 => p_run_information1
,p_run_information2 => p_run_information2
,p_run_information3 => p_run_information3
,p_run_information4 => p_run_information4
,p_run_information5 => p_run_information5
,p_run_information6 => p_run_information6
,p_run_information7 => p_run_information7
,p_run_information8 => p_run_information8
,p_run_information9 => p_run_information9
,p_run_information10 => p_run_information10
,p_run_information11 => p_run_information11
,p_run_information12 => p_run_information12
,p_run_information13 => p_run_information13
,p_run_information14 => p_run_information14
,p_run_information15 => p_run_information15
,p_run_information16 => p_run_information16
,p_run_information17 => p_run_information17
,p_run_information18 => p_run_information18
,p_run_information19 => p_run_information19
,p_run_information20 => p_run_information20
,p_run_information21 => p_run_information21
,p_run_information22 => p_run_information22
,p_run_information23 => p_run_information23
,p_run_information24 => p_run_information24
,p_run_information25 => p_run_information25
,p_run_information26 => p_run_information26
,p_run_information27 => p_run_information27
,p_run_information28 => p_run_information28
,p_run_information29 => p_run_information29
,p_run_information30 => p_run_information30
,p_effective_start_date => l_out_esd
,p_effective_end_date => l_out_eed
);
select run_type_id
, run_type_name
, shortname
, srs_flag
, run_information_category
, run_information1
, run_information2
, run_information3
, run_information4
, run_information5
, run_information6
, run_information7
, run_information8
, run_information9
, run_information10
, run_information11
, run_information12
, run_information13
, run_information14
, run_information15
, run_information16
, run_information17
, run_information18
, run_information19
, run_information20
, run_information21
, run_information22
, run_information23
, run_information24
, run_information25
, run_information26
, run_information27
, run_information28
, run_information29
, run_information30
, legislation_code
, business_group_id
, effective_start_date
, effective_end_date
, object_version_number
, l_mode
into rec_uploaded
from pay_run_types_f
where run_type_id = rec_uploaded.rt_id
and effective_start_date = l_out_esd
and effective_end_date = l_out_eed;
end update_row;
select run_type_usage_id
, object_version_number
, business_group_id
, legislation_code
from pay_run_type_usages_f
where parent_run_type_id = rec_uploaded.rt_id
and effective_end_date >= g_to_be_uploaded_eed;
select 1
from pay_run_types_f_tl
where run_type_id = rec_uploaded.rt_id;
hr_startup_data_api_support.delete_owner_definitions;
pay_run_type_usage_api.delete_run_type_usage
(p_effective_date => g_to_be_uploaded_eed
,p_datetrack_delete_mode => 'ZAP'
,p_run_type_usage_id => each_child.run_type_usage_id
,p_object_version_number => each_child.object_version_number
,p_business_group_id => each_child.business_group_id
,p_legislation_code => each_child.legislation_code
,p_effective_start_date => l_out_esd
,p_effective_end_date => l_out_eed
);
pay_run_type_api.delete_run_type
(p_effective_date => g_to_be_uploaded_eed
,p_datetrack_delete_mode => 'DELETE'
,p_run_type_id => rec_uploaded.rt_id
,p_object_version_number => rec_uploaded.rt_ovn
,p_business_group_id => rec_uploaded.rt_bg
,p_legislation_code => rec_uploaded.rt_leg_code
,p_effective_start_date => l_out_esd
,p_effective_end_date => l_out_eed
);
insert_row;
zap_insert(l_rt_id);
insert_row;
zap_insert(l_rt_id);
insert_row;
zap_insert(l_rt_id);
update_row;
select run_type_usage_id
, parent_run_type_id
, child_run_type_id
, sequence
, legislation_code
, business_group_id
, effective_start_date
, effective_end_date
, object_version_number
from pay_run_type_usages_f
where parent_run_type_id = p_parent_rt_id
and child_run_type_id = p_child_rt_id
and business_group_id = (select pbg.business_group_id
from per_business_groups pbg
where upper(pbg.name) = p_business_group)
and legislation_code is null;
select run_type_usage_id
, parent_run_type_id
, child_run_type_id
, sequence
, legislation_code
, business_group_id
, effective_start_date
, effective_end_date
, object_version_number
from pay_run_type_usages_f
where parent_run_type_id = p_parent_rt_id
and child_run_type_id = p_child_rt_id
and legislation_code = p_legislation_code
and business_group_id is null;
select run_type_usage_id
, parent_run_type_id
, child_run_type_id
, sequence
, legislation_code
, business_group_id
, effective_start_date
, effective_end_date
, object_version_number
from pay_run_type_usages_f
where parent_run_type_id = p_parent_rt_id
and child_run_type_id = p_child_rt_id
and business_group_id is null
and legislation_code is null;
select business_group_id
from per_business_groups
where UPPER(name) = upper(p_bg_name);
select prt.run_type_id
from pay_run_types_f prt
where prt.run_type_name = p_parent_run_type_name
and p_effective_start_date between prt.effective_start_date
and prt.effective_end_date
and ((p_business_group is not null
and prt.business_group_id = p_bg_id)
or (p_legislation_code is not null
and prt.legislation_code = p_legislation_code)
or (p_business_group is null
and p_legislation_code is null
and prt.business_group_id is null
and prt.legislation_code is null));
select prt.run_type_id
from pay_run_types_f prt
where prt.run_type_name = p_child_run_type_name
and p_effective_start_date between prt.effective_start_date
and prt.effective_end_date
and ((p_child_bg is not null
and prt.business_group_id = p_bg_id)
or (p_child_leg_code is not null
and prt.legislation_code = p_child_leg_code)
or (p_child_bg is null
and p_legislation_code is null
and prt.business_group_id is null
and prt.legislation_code is null));
select run_type_usage_id
from pay_run_type_usages_f
where parent_run_type_id = p_par_id
and sequence = p_sequence_num
and p_eff_st_date between effective_start_date
and effective_end_date;
procedure insert_row is
--
begin
--
hr_startup_data_api_support.enable_startup_mode(l_mode);
hr_startup_data_api_support.delete_owner_definitions;
select run_type_usage_id
, parent_run_type_id
, child_run_type_id
, sequence
, legislation_code
, business_group_id
, effective_start_date
, effective_end_date
, object_version_number
, l_mode
into rec_rtu_uploaded
from pay_run_type_usages_f
where run_type_usage_id = l_out_rtu_id;
end insert_row;
procedure zap_insert(p_rtu_id number) is
--
begin
--
hr_startup_data_api_support.enable_startup_mode(l_mode);
hr_startup_data_api_support.delete_owner_definitions;
delete from pay_run_type_usages_f
where run_type_usage_id = p_rtu_id;
delete from pay_run_type_usages_f
where run_type_usage_id = l_valid_seq;
select run_type_usage_id
, parent_run_type_id
, child_run_type_id
, sequence
, legislation_code
, business_group_id
, effective_start_date
, effective_end_date
, object_version_number
, l_mode
into rec_rtu_uploaded
from pay_run_type_usages_f
where run_type_usage_id = l_out_rtu_id;
end zap_insert;
procedure update_row is
--
begin
--
hr_startup_data_api_support.enable_startup_mode(l_mode);
hr_startup_data_api_support.delete_owner_definitions;
pay_run_type_usage_api.update_run_type_usage
(p_effective_date => p_effective_start_date
,p_datetrack_update_mode => 'UPDATE'
,p_run_type_usage_id => rec_rtu_uploaded.rtu_id
,p_object_version_number => rec_rtu_uploaded.rtu_ovn
,p_sequence => p_sequence
,p_business_group_id => l_bg
,p_legislation_code => p_legislation_code
,p_effective_start_date => l_out_esd
,p_effective_end_date => l_out_eed
);
select run_type_usage_id
, parent_run_type_id
, child_run_type_id
, sequence
, legislation_code
, business_group_id
, effective_start_date
, effective_end_date
, object_version_number
, l_mode
into rec_rtu_uploaded
from pay_run_type_usages_f
where run_type_usage_id = rec_rtu_uploaded.rtu_id
and effective_start_date = l_out_esd
and effective_end_date = l_out_eed;
end update_row;
hr_startup_data_api_support.delete_owner_definitions;
pay_run_type_usage_api.delete_run_type_usage
(p_effective_date => g_rtu_to_be_uploaded_eed
,p_datetrack_delete_mode => 'DELETE'
,p_run_type_usage_id => rec_rtu_uploaded.rtu_id
,p_object_version_number => rec_rtu_uploaded.rtu_ovn
,p_business_group_id => rec_rtu_uploaded.rtu_bg
,p_legislation_code => rec_rtu_uploaded.rtu_leg_code
,p_effective_start_date => l_out_esd
,p_effective_end_date => l_out_eed
);
insert_row;
zap_insert(l_rtu_id);
insert_row;
zap_insert(l_rtu_id);
insert_row;
zap_insert(l_rtu_id);
update_row;
select business_group_id
from per_business_groups
where upper(name) = p_rt_bg;
select run_type_id
from pay_run_types_f
where run_type_name = p_base_rt_name
and nvl(business_group_id, -1) = nvl(p_bg_id, -1)
and nvl(legislation_code, 'CORE') = nvl(p_rt_leg_code, 'CORE');
select run_type_org_method_id
, object_version_number
, effective_start_date
, effective_end_date
from pay_run_type_org_methods_f
where run_type_id = l_rt_id
and org_payment_method_id = l_opm_id
and business_group_id = l_bg_id;
procedure zap_insert_rom is
--
begin
--
hr_startup_data_api_support.enable_startup_mode('USER');
pay_run_type_org_method_api.delete_run_type_org_method(
p_effective_date => p_effective_start_date
,p_datetrack_delete_mode => 'ZAP'
,p_run_type_org_method_id => l_rom_id
,p_object_version_number => l_ovn
,p_effective_start_date => l_esd
,p_effective_end_date => l_eed);
procedure insert_rom is
--
begin
--
hr_startup_data_api_support.enable_startup_mode('USER');
procedure update_rom is
--
begin
--
hr_startup_data_api_support.enable_startup_mode('USER');
pay_run_type_org_method_api.update_run_type_org_method(
p_effective_date => p_effective_start_date
,p_datetrack_update_mode => 'UPDATE'
,p_run_type_org_method_id => g_rom_rec.new_rom_id
,p_object_version_number => g_rom_rec.ovn
,p_priority => p_priority
,p_percentage => p_percentage
,p_amount => p_amount
,p_business_group_id => l_bg_id
,p_effective_start_date => l_out_esd
,p_effective_end_date => l_out_eed);
pay_run_type_org_method_api.delete_run_type_org_method(
p_effective_date => g_rom_rec.old_eed
,p_datetrack_delete_mode => 'DELETE'
,p_run_type_org_method_id => g_rom_rec.new_rom_id
,p_object_version_number => g_rom_rec.ovn
,p_effective_start_date => g_rom_rec.new_esd
,p_effective_end_date => g_rom_rec.new_eed);
select business_group_id
, legislation_code
into l_bg_id
, l_lc
from per_business_groups
where UPPER(name) = p_business_group;
select prt.run_type_id
into l_rt_id
from pay_run_types_f prt
where UPPER(prt.run_type_name) = p_rt_name
and p_effective_start_date between prt.effective_start_date
and prt.effective_end_date
and ((p_rt_bg is not null
and prt.business_group_id = l_bg_id)
or (p_rt_lc is not null
and prt.legislation_code = p_rt_lc)
or (p_rt_bg is null
and p_rt_lc is null
and prt.business_group_id is null
and prt.legislation_code is null));
select popm.org_payment_method_id
into l_opm_id
from pay_org_payment_methods_f popm
where UPPER(popm.org_payment_method_name) = p_opm_name
and p_effective_start_date between popm.effective_start_date
and popm.effective_end_date
and popm.business_group_id = l_bg_id;
zap_insert_rom;
update_rom;
insert_rom;
select element_type_usage_id
, object_version_number
, legislation_code
, business_group_id
, effective_start_date
, effective_end_date
from pay_element_type_usages_f
where run_type_id = l_in_rt_id
and element_type_id = l_in_et_id
and ((business_group_id = l_in_bg_id)
or (legislation_code = l_in_lc)
or (business_group_id is null
and legislation_code is null));
select element_type_usage_id
, object_version_number
, legislation_code
, business_group_id
, effective_start_date
, effective_end_date
from pay_element_type_usages_f
where run_type_id = l_in_rt_id
and element_type_id = l_in_et_id
and ((business_group_id in (select business_group_id
from per_business_groups
where legislation_code = p_legislative_code))
or (legislation_code = p_legislative_code)
or (business_group_id is null
and legislation_code is null));
select element_type_usage_id
, object_version_number
, legislation_code
, business_group_id
, effective_start_date
, effective_end_date
from pay_element_type_usages_f
where run_type_id = l_in_rt_id
and element_type_id = l_in_et_id;
procedure insert_etu is
--
begin
--
hr_startup_data_api_support.enable_startup_mode(l_mode);
hr_startup_data_api_support.delete_owner_definitions;
hr_startup_data_api_support.delete_owner_definitions;
pay_element_type_usage_api.delete_element_type_usage(
p_effective_date => g_etu_rec.old_eed
,p_datetrack_delete_mode => 'DELETE'
,p_element_type_usage_id => g_etu_rec.new_etu_id
,p_object_version_number => g_etu_rec.ovn
,p_effective_start_date => g_etu_rec.new_esd
,p_effective_end_date => g_etu_rec.new_eed);
procedure zap_insert_etu is
--
begin
--
hr_startup_data_api_support.enable_startup_mode(l_mode);
hr_startup_data_api_support.delete_owner_definitions;
pay_element_type_usage_api.delete_element_type_usage(
p_effective_date => p_effective_start_date
,p_datetrack_delete_mode => 'ZAP'
,p_element_type_usage_id => l_etu_id
,p_object_version_number => l_ovn
,p_effective_start_date => l_esd
,p_effective_end_date => l_eed);
hr_startup_data_api_support.delete_owner_definitions;
procedure update_etu is
--
begin
--
hr_startup_data_api_support.enable_startup_mode(l_mode);
hr_startup_data_api_support.delete_owner_definitions;
pay_element_type_usage_api.update_element_type_usage(
p_effective_date => p_effective_start_date
,p_datetrack_update_mode => 'UPDATE'
,p_inclusion_flag => p_inclusion_flag
,p_element_type_usage_id => l_etu_id
,p_object_version_number => l_ovn
,p_business_group_id => l_in_bg_id
,p_legislation_code => p_legislative_code
,p_usage_type => p_usage_type
,p_effective_start_date => l_out_esd
,p_effective_end_date => l_out_eed);
select business_group_id
, legislation_code
into l_in_bg_id
, l_in_lc
from per_business_groups
where UPPER(name) = p_business_group;
select prt.run_type_id
into l_in_rt_id
from pay_run_types_f prt
where UPPER(prt.run_type_name) = p_rt_name
and p_effective_start_date between prt.effective_start_date
and prt.effective_end_date
and ((p_rt_bg_name is not null
and prt.business_group_id = l_in_bg_id)
or (p_rt_leg_code is not null
and prt.legislation_code = p_rt_leg_code)
or (p_rt_bg_name is null
and p_rt_leg_code is null
and prt.business_group_id is null
and prt.legislation_code is null));
select pet.element_type_id
into l_in_et_id
from pay_element_types_f pet
where UPPER(pet.element_name) = p_element_name
and p_effective_start_date between pet.effective_start_date
and pet.effective_end_date
and ((p_et_bg_name is not null
and pet.business_group_id = l_in_bg_id)
or (p_et_leg_code is not null
and pet.legislation_code = p_et_leg_code)
or (p_et_bg_name is null
and p_et_leg_code is null
and pet.business_group_id is null
and pet.legislation_code is null));
update_etu;
zap_insert_etu;
insert_etu;
update_etu;
zap_insert_etu;
insert_etu;
update_etu;
zap_insert_etu;
insert_etu;
select pbg.business_group_id
from per_business_groups pbg
where pbg.name = p_bg_name;
select prt.run_type_name
, prt.run_method
from pay_run_types_f prt
, pay_run_type_usages_f rtu
where prt.run_method = 'C'
and nvl(prt.legislation_code, 'NULL') = nvl(p_leg_code, 'NULL')
and nvl(prt.business_group_id, -1) = nvl(p_bg, -1)
and prt.run_type_name = p_rt_name
and prt.run_type_id = rtu.child_run_type_id;