The following lines contain the word 'select', 'insert', 'update' or 'delete':
v_delete_permitted varchar2(1);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from po_vendors pov
where pov.employee_id = P_PERSON_ID);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from hr_locations hr
where hr.designated_receiver_id = P_PERSON_ID);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from po_agents po
where po.agent_id = P_PERSON_ID);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from po_acceptances po
where po.employee_id = P_PERSON_ID);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from po_quotation_approvals_all po
where po.approver_id = P_PERSON_ID);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from po_headers_all po
where po.agent_id = P_PERSON_ID)
and not exists (
select null
from po_headers_archive_all po
where po.agent_id = P_PERSON_ID);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from po_distributions_all po
where po.deliver_to_person_id = P_PERSON_ID)
and not exists (
select null
from po_distributions_archive_all po
where po.deliver_to_person_id = P_PERSON_ID);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from po_notifications_all po
where po.employee_id = P_PERSON_ID);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from po_releases_all po
where po.agent_id = P_PERSON_ID
or po.cancelled_by = P_PERSON_ID
or po.hold_by = P_PERSON_ID)
and not exists (
select null
from po_releases_archive_all po
where po.agent_id = P_PERSON_ID
or po.cancelled_by = P_PERSON_ID
or po.hold_by = P_PERSON_ID);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from po_requisitions_interface_all po
where po.approver_id = P_PERSON_ID
or po.deliver_to_requestor_id = P_PERSON_ID
or po.suggested_buyer_id = P_PERSON_ID
or po.preparer_id = P_PERSON_ID);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from po_requisition_headers_all po
where po.preparer_id = P_PERSON_ID);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from po_requisition_lines_all po
where po.to_person_id = P_PERSON_ID
or po.purchasing_agent_id = P_PERSON_ID
or po.research_agent_id = P_PERSON_ID);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from po_action_history po
where po.employee_id = P_PERSON_ID);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from po_employee_hierarchies po
where po.employee_id = P_PERSON_ID
or po.superior_id = P_PERSON_ID);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from po_lines_all po
where po.cancelled_by = P_PERSON_ID
or po.closed_by = P_PERSON_ID)
and not exists (
select null
from po_lines_archive_all po
where po.cancelled_by = P_PERSON_ID
or po.closed_by = P_PERSON_ID);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from po_line_locations_all po
where po.cancelled_by = P_PERSON_ID
or po.closed_by = P_PERSON_ID)
and not exists (
select null
from po_line_locations_archive_all po
where po.cancelled_by = P_PERSON_ID
or po.closed_by = P_PERSON_ID);
select 'Y'
into v_delete_permitted
from sys.dual
where not exists (
select null
from po_reqexpress_lines_all po
where po.suggested_buyer_id = P_PERSON_ID);