Possible enhancements:-
Add Phase Code
Add Status Code
Add Detail Message
-
set serveroutput on
-
-
create or replace package IC_RJMTMP as
-
procedure exec(p_requestID in number);
-
end;
-
/
-
show errors;
-
/
-
-
create or replace package body IC_RJMTMP as
-
g_space varchar(255) := '========================================================================================';
-
procedure outputRequestTREE(p_requestID in number, p_lev in number)
-
is
-
cursor children is
-
select
-
fcr.request_id
-
from fnd_concurrent_requests fcr
-
where fcr.parent_request_id=p_requestID
-
order by fcr.request_date
-
;
-
children_rec children%rowtype;
-
-
l_request_id fnd_concurrent_requests.request_id%type;
-
l_Description fnd_concurrent_requests.description%type;
-
l_parent_requesT_id fnd_concurrent_requests.parent_request_id%type;
-
l_argument_text fnd_concurrent_requests.argument_text%type;
-
begin
-
select
-
fcr.request_id,
-
fcpt.user_concurrent_program_name as description,
-
fcr.parent_requesT_id,
-
fcr.argument_Text
-
into
-
l_request_id,
-
l_description,
-
l_parent_request_id,
-
l_argument_text
-
from fnd_concurrent_requests fcr
-
left join (
-
select * from fnd_concurrent_programs_tl
-
) fcpt on fcpt.concurrent_program_id=fcr.concurrent_program_id and fcpt.application_id=fcr.program_application_id
-
where (
-
request_id=p_requestID
-
)
-
order by request_date asc;
-
-
dbms_output.put_line(substr(g_space,0,p_lev*2) || to_char(l_request_id) || ' ' || l_description || ' (' || l_argument_text || ')');
-
FOR children_rec IN children LOOP
-
outputRequestTREE(children_rec.request_id,p_lev+1);
-
END LOOP;
-
end;
-
-
procedure exec(p_requestID in number)
-
is
-
begin
-
dbms_output.put_line('Start');
-
outputRequestTREE(p_requesTID,0);
-
dbms_output.put_line('End');
-
end;
-
end;
-
/
-
show errors;
-
/
-
begin
-
IC_RJMTMP.exec(45243208);
-
end;
-
/
-
drop package body IC_RJMTMP;
-
drop package IC_RJMTMP;
-
/
Codes
STATUS_CODE Column:
A - Waiting
B - Resuming
C - Normal
D - Cancelled
E - Error
F - Scheduled
G - Warning
H - On Hold
I - Normal
M - No Manager
Q - Standby
R - Normal
S - Suspended
T - Terminating
U - Disabled
W - Paused
X - Terminated
Z - Waiting
PHASE_CODE column
C - Completed
I - Inactive
P - Pending
R - Running
RJM Article Type
Quick Reference