The following lines contain the word 'select', 'insert', 'update' or 'delete':
Procedure chk_non_updateable_args
(p_rec in per_cag_shd.g_rec_type) IS
--
l_proc varchar2(72) := g_package || 'chk_non_updateable_args';
End chk_non_updateable_args;
cursor csr_status is select 1
from hr_lookups
where lookup_type = 'CAGR_STATUS'
and lookup_code = p_status ;
cursor csr_employers is select '1'
from hr_employers_v hev
where hev.organization_id = p_employer_organization_id AND
hev.business_group_id = p_business_group_id;
/* for each insert or in update only if the employer_organization_id value is different */
if (p_collective_agreement_id is null and p_employer_organization_id IS NOT NULL) OR
(p_collective_agreement_id is NOT null AND
per_cag_shd.g_old_rec.employer_organization_id <> p_employer_organization_id) Then
begin
open csr_employers;
cursor csr_bargaining_units is select '1'
from hr_bargaining_units_v hbu
where hbu.organization_id = p_bargaining_organization_id AND
hbu.business_group_id = p_business_group_id;
/* for each insert or in update only if the employer_organization_id value is different */
if (p_collective_agreement_id is null and p_bargaining_organization_id IS NOT NULL) OR
(p_collective_agreement_id is NOT null AND
per_cag_shd.g_old_rec.bargaining_organization_id <> p_bargaining_organization_id) Then
begin
open csr_bargaining_units;
Procedure insert_validate(p_rec in per_cag_shd.g_rec_type) is
--
l_proc varchar2(72) := g_package||'insert_validate';
End insert_validate;
Procedure update_validate(p_rec in per_cag_shd.g_rec_type) is
--
l_proc varchar2(72) := g_package||'update_validate';
chk_non_updateable_args
(p_rec => p_rec);
End update_validate;
Procedure delete_validate(p_rec in per_cag_shd.g_rec_type) is
cursor csr_assignment is select '1'
from per_all_assignments_f paa
where paa.collective_agreement_id = p_rec.collective_agreement_id;
cursor csr_establishment is select '1'
from hr_estab_coll_agrs_v hfe
where to_number(substr(hfe.collective_agreement_id,1,30)) = p_rec.collective_agreement_id;
cursor csr_grade is select '1'
from per_cagr_grade_structures pcg
where pcg.collective_agreement_id = p_rec.collective_agreement_id;
SELECT 1
FROM per_cagr_entitlements pce
WHERE pce.collective_agreement_id = p_rec.collective_agreement_id;
l_proc varchar2(72) := g_package||'delete_validate';
End delete_validate;
select pbg.legislation_code
from per_business_groups pbg
, per_collective_agreements cag
where cag.collective_agreement_id = p_collective_agreement_id
and pbg.business_group_id = cag.business_group_id;