The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT MAX(sequence_number)
FROM pa_wf_ntf_performers
WHERE
wf_type_code = 'APPROVAL_FYI'
AND item_type = itemtype
AND item_key = itemkey
AND object_id2 = l_object_id;
select party_name
from (
select fu.user_name, hp.party_name, hp.email_address
from fnd_user fu,
hz_parties hp
where fu.person_party_id = hp.party_id -- Bug 4527617. Replaced customer_id with person_party_id.
and fu.user_name = l_user_name
union all
select fu.user_name, papf.full_name, papf.email_address
from fnd_user fu,
hz_parties hp,
per_all_people_f papf
where 'PER:' || fu.employee_id = hp.orig_system_reference
and fu.user_name = l_user_name
and trunc(sysdate)
between papf.EFFECTIVE_START_DATE
and Nvl(papf.effective_end_date, Sysdate + 1)
and papf.person_id = fu.employee_id);
INSERT INTO pa_wf_ntf_performers
(
wf_type_code,
item_type,
item_key,
object_id1,
object_id2,
user_name,
user_type,
action_code,
action_date,
sequence_number,
approver_comments
)
VALUES
(
'APPROVAL_FYI',
itemtype,
itemkey,
l_project_id,
l_object_id,
user_name,
'RESOURCE',
funcmode,
Sysdate,
l_seq +1 ,
comment
);
SELECT DISTINCT
pw.sequence_number,
wu.display_name user_full_name,
pl.meaning action_code,
pw.action_date,
pw.approver_comments
FROM pa_wf_ntf_performers pw, wf_users wu, pa_lookups pl
WHERE --pw.wf_type_code = 'APPROVAL_FYI'
pw.item_type = l_item_type -- 'PAWFPPRA'
AND pw.item_key = l_item_key --32715
AND pw.object_id2 = l_object_id --10020
and pw.user_name = wu.name
and pl.lookup_type = 'PA_WF_APPROVAL_ACTION'
and pl.lookup_code = pw.action_code
ORDER BY pw.sequence_number ;
SELECT
pw.sequence_number,
wu.display_name user_full_name,
pw.action_code,
pw.action_date,
pw.approver_comments
FROM pa_wf_ntf_performers pw, wf_users wu
WHERE --pw.wf_type_code = 'APPROVAL_FYI'
pw.item_type = l_item_type
AND pw.item_key = l_item_key
AND pw.object_id2 = l_object_id
and pw.user_name = wu.name
ORDER BY pw.sequence_number ;
SELECT DISTINCT
wu.display_name user_full_name,
pl.meaning action_code,
pw.action_date,
pw.approver_comments
FROM pa_wf_ntf_performers pw, wf_users wu, pa_lookups pl
WHERE --pw.wf_type_code = 'APPROVAL_FYI'
pw.item_type = l_item_type -- 'PAWFPPRA'
AND pw.item_key = l_item_key --32715
AND pw.object_id2 = l_object_id --10020
and pw.user_name = wu.name
and pl.lookup_type = 'PA_WF_APPROVAL_ACTION'
and pl.lookup_code = pw.action_code
and pl.lookup_code = 'SUBMIT' ;
select distinct
pl.meaning action_code,
ias.end_date action_date,
wu.display_name user_full_name
from wf_item_activity_statuses ias,
wf_process_activities pa,
wf_users wu,pa_lookups pl
where ias.item_type = l_item_type
and ias.item_key = l_item_key
and pa.instance_label = 'CI_APPROVAL_REQUEST'
and ias.process_activity = pa.instance_id
and wu.name = ias.assigned_user
and pl.lookup_type = 'PA_WF_APPROVAL_ACTION'
and pl.lookup_code = ias.activity_result_code;