SELECT ias.item_type, ias.item_key, ias.execution_time,
ac.FUNCTION function_name,
TO_CHAR (ias.begin_date, 'DD-MON-RR HH24:MI:SS') begin_date,
ap.display_name || '/' || ac.display_name activity,
ias.activity_status
activity_status, ias.activity_result_code RESULT,
ias.assigned_user ass_user, ias.notification_id,
wfn.status notif_status, wfn.subject notif_subject
FROM wf_item_activity_statuses
ias,
wf_process_activities pa,
wf_activities_vl ac,
wf_activities_vl ap,
wf_items i,
wf_notifications wfn
WHERE ias.item_type = '&item_type'
AND ias.item_key = '&item_key'
AND ias.process_activity = pa.instance_id
AND pa.activity_name = ac.NAME
AND pa.activity_item_type = ac.item_type
AND pa.process_name = ap.NAME
AND pa.process_item_type = ap.item_type
AND pa.process_version = ap.VERSION
AND wfn.notification_id(+) = ias.notification_id
AND i.item_type = ias.item_type
AND i.item_key = ias.item_key
AND i.begin_date >= ac.begin_date
AND i.begin_date < NVL (ac.end_date, i.begin_date + 1)
ORDER BY 2, 3
No comments:
Post a Comment