The following lines contain the word 'select', 'insert', 'update' or 'delete':
per_delete_allowed varchar2(1);
select 'X'
into per_delete_allowed
from sys.dual
where not exists (
select null
from pa_implementations_all imp,
per_all_people_f per
-- per_person_types ptypes -- commenting out for CWK 11.5.10
where per.person_id = p_person_id
and per.business_group_id = imp.business_group_id
and (per.current_employee_flag = 'Y' OR -- for 11.5.10 CWK
per.current_npw_flag = 'Y')); -- for FP M CWK
v_delete_permitted varchar2(1);
SELECT 'X'
FROM fnd_product_installations fpi
, pa_implementations_all imp
WHERE fpi.application_id = 275
AND fpi.status = 'I';
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from pa_compensation_details pa
where pa.person_id = P_PERSON_ID);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from pa_emp_bill_rate_overrides pa
where pa.project_id > -1
and pa.task_id > -1
and pa.person_id = P_PERSON_ID);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from pa_job_assignment_overrides pa
where ((pa.project_id > -1 AND
pa.person_id = P_PERSON_ID)
OR
(pa.task_id > -1 AND
pa.person_id = P_PERSON_ID)));
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select /*+ INDEX ( pa PA_BILL_RATES_U1 ) */
null
from pa_bill_rates pa
where pa.bill_rate_organization_id > -1
and pa.std_bill_rate_schedule <> 'DUMMY'
and pa.person_id = P_PERSON_ID);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from pa_project_players pa
where pa.person_id = P_PERSON_ID);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from pa_agreements pa
where pa.owned_by_person_id = P_PERSON_ID);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from pa_tasks pa
where pa.task_manager_person_id = P_PERSON_ID);
select /*+ INDEX (pa PA_CREDIT_RECEIVERS_U1) */
'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from pa_credit_receivers pa
where pa.person_id = P_PERSON_ID);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from pa_expenditures pa
where pa.incurred_by_person_id = P_PERSON_ID);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from pa_expenditures pa
where pa.entered_by_person_id = P_PERSON_ID);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from pa_draft_invoices pa
where pa.approved_by_person_id = P_PERSON_ID
or pa.released_by_person_id = P_PERSON_ID);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from pa_employee_accum pa
where pa.person_id = P_PERSON_ID);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from pa_routings pa
where (pa.routed_to_person_id = P_PERSON_ID
OR
pa.routed_from_person_id = P_PERSON_ID));
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from pa_transaction_controls pa
where pa.project_id > -1
and pa.person_id = P_PERSON_ID);
hr_utility.set_message (275,'PA_PER_CANT_DELETE');