The following lines contain the word 'select', 'insert', 'update' or 'delete':
select business_group_id
from per_assignments_f asg
where asg.assignment_id = p_assignment_id
and p_effective_date between asg.effective_start_date
and asg.effective_end_date;
select null
from pay_ca_emp_fed_tax_info_f fed
where fed.assignment_id = p_assignment_id
and p_effective_date between fed.effective_start_date
and fed.effective_end_date;
Procedure dt_update_validate
(p_assignment_id in number default hr_api.g_number,
p_datetrack_mode in varchar2,
p_validation_start_date in date,
p_validation_end_date in date) Is
--
l_proc varchar2(72) := g_package||'dt_update_validate';
End dt_update_validate;
Procedure dt_delete_validate
(p_emp_province_tax_inf_id in number,
p_datetrack_mode in varchar2,
p_validation_start_date in date,
p_validation_end_date in date) Is
--
l_proc varchar2(72) := g_package||'dt_delete_validate';
If (p_datetrack_mode = 'DELETE' or
p_datetrack_mode = 'ZAP') then
--
--
-- Ensure the arguments are not null
--
hr_api.mandatory_arg_error
(p_api_name => l_proc,
p_argument => 'validation_start_date',
p_argument_value => p_validation_start_date);
End dt_delete_validate;
Procedure insert_validate
(p_rec in pay_cpt_shd.g_rec_type,
p_effective_date in date,
p_datetrack_mode in varchar2,
p_validation_start_date in date,
p_validation_end_date in date) is
--
l_proc varchar2(72) := g_package||'insert_validate';
End insert_validate;
Procedure update_validate
(p_rec in pay_cpt_shd.g_rec_type,
p_effective_date in date,
p_datetrack_mode in varchar2,
p_validation_start_date in date,
p_validation_end_date in date) is
--
l_proc varchar2(72) := g_package||'update_validate';
dt_update_validate
(p_assignment_id => p_rec.assignment_id,
p_datetrack_mode => p_datetrack_mode,
p_validation_start_date => p_validation_start_date,
p_validation_end_date => p_validation_end_date);
End update_validate;
Procedure delete_validate
(p_rec in pay_cpt_shd.g_rec_type,
p_effective_date in date,
p_datetrack_mode in varchar2,
p_validation_start_date in date,
p_validation_end_date in date) is
-- commented csr_assigned cursor definition and redifined below, bug 6059473.
-- while checking whether any PAYROLL is execute, we have to consider
-- that we cannot terminate tax record if Final Process Date is
-- less than DATE EARNED.
/* cursor csr_assigned is
select PA.context_value from
pay_action_contexts PA,
ff_contexts C,
pay_ca_emp_prov_tax_info_f PR
where C.context_id = PA.context_id
and C.context_name = 'JURISDICTION_CODE'
and PA.context_value = PR.province_code
and PA.assignment_id = PR.assignment_id
and PR.emp_province_tax_inf_id = p_rec.emp_province_tax_inf_id; */
select PA.context_value from
pay_action_contexts PA,
ff_contexts C,
pay_ca_emp_prov_tax_info_f PR,
pay_assignment_actions paa,
per_assignments_f paf
where C.context_id = PA.context_id
and C.context_name = 'JURISDICTION_CODE'
and PA.context_value = PR.province_code
and PA.assignment_id = PR.assignment_id
and PR.emp_province_tax_inf_id = p_rec.emp_province_tax_inf_id
and paf.assignment_id = PR.assignment_id
and paf.assignment_id = paa.assignment_id
and exists (select null
from pay_payroll_actions ppa,
pay_payrolls_f ppf
where ppa.payroll_action_id = paa.payroll_action_id
and ppa.action_type in ('Q','R')
and ppa.date_earned > p_csr_tmp_date
and ppa.payroll_id = ppf.payroll_id
and ppa.effective_date between ppf.effective_start_date
and ppf.effective_end_date
and ppf.payroll_id > 0
and ppf.payroll_id = paf.payroll_id
);
l_proc varchar2(72) := g_package||'delete_validate';
dt_delete_validate
(p_datetrack_mode => p_datetrack_mode,
p_validation_start_date => p_validation_start_date,
p_validation_end_date => p_validation_end_date,
p_emp_province_tax_inf_id => p_rec.emp_province_tax_inf_id);
End delete_validate;
select a.legislation_code
from per_business_groups a,
pay_ca_emp_prov_tax_info_f b
where b.emp_province_tax_inf_id = p_emp_province_tax_inf_id
and a.business_group_id = b.business_group_id;