The following lines contain the word 'select', 'insert', 'update' or 'delete':
select to_number(substr(application_column_name, 10)) num
from fnd_descr_flex_column_usages
where application_id = appl_id
and descriptive_flexfield_name = '$SRS$.'||prog_name
and descriptive_flex_context_code = 'Global Data Elements'
and enabled_flag = 'Y'
order by column_seq_num;
select user_concurrent_program_name,
concurrent_program_name,
srs_flag,
enabled_flag,
run_alone_flag,
queue_method_code,
execution_options,
printer_name,
output_print_style,
required_style
into pname,
sname,
srs,
eflag,
rflag,
qcode,
eopts,
prntr,
pstyl,
rstyl
from fnd_concurrent_programs_vl
where concurrent_program_id = cpid
and application_id = appid;
select user_name
into uname
from fnd_user
where user_id = uid;
select user_printer_style_name
into ustyl
from fnd_printer_styles_vl
where printer_style_name = pstyl;
select property_value
into default_edition
from database_properties
where property_name = 'DEFAULT_EDITION';
select edition_name
into edname
from fnd_concurrent_requests
where request_id = rid;
select 'I',
'M'
into upcode,
uscode
from sys.dual
where not exists (select null
from fnd_concurrent_worker_requests
where request_id = rid
and running_processes > 0
and (not (queue_application_id = 0
and concurrent_queue_id in (1,4))
or queue_control_flag = 'Y'));
select ph.meaning into phase
from fnd_lookups ph
where ph.lookup_type = PHASE_LOOKUP_TYPE
and ph.lookup_code = upcode;
select st.meaning into status
from fnd_lookups st
where st.lookup_type = STATUS_LOOKUP_TYPE
and st.lookup_code = uscode;
select lookup_code
into upcode
from fnd_lookups
where lookup_type = PHASE_LOOKUP_TYPE
and meaning like phase
order by lookup_code;
select lookup_code
into uscode
from fnd_lookups
where lookup_type = STATUS_LOOKUP_TYPE
and meaning like status
order by lookup_code;
select status_code
into dummy
from fnd_concurrent_requests
where request_id = rid
and has_sub_request = 'Y'
and status_code = 'W'
for update of status_code;
update fnd_concurrent_requests
set status_code = 'I',
last_update_date = sysdate,
last_updated_by = uid
where request_id = prid
and has_sub_request = 'Y'
and status_code = 'W'
and not exists (select null
from fnd_concurrent_requests
where parent_request_id = prid
and request_id <> rid
and is_sub_request = 'Y'
and status_code between 'I' and 'T');
procedure delete_children (rid in number,
uid in number) is
begin
update fnd_concurrent_requests
set phase_code = decode (status_code,
'R', 'R',
'C'),
status_code = decode (phase_code,
'R', decode (status_code,
'R', 'T',
'X'),
'D'),
last_update_date = sysdate,
last_updated_by = uid
where request_id in (select request_id
from fnd_concurrent_requests
where phase_code <> 'C' and status_code <> 'T'
connect by prior request_id = parent_request_id
start with request_id = rid);
end delete_children;
select count (*) + 1
into reqpos
from fnd_concurrent_worker_requests b
where (b.priority < pri
or (b.priority = pri
and b.requested_start_date < stdate)
or (b.priority = pri
and b.requested_start_date = stdate)
and b.request_id <= rid)
and b.concurrent_queue_name = qname
and b.queue_application_id = qappid
and b.phase_code = 'P'
and b.hold_flag <> 'Y'
and b.requested_start_date <= sysdate;
select count (*)
into runreqs
from fnd_concurrent_worker_requests
where concurrent_queue_name = qname
and queue_application_id = qappid
and phase_code = 'R';
select count (*)
into pendreqs
from fnd_concurrent_worker_requests
where concurrent_queue_name = qname
and queue_application_id = qappid
and phase_code = 'P'
and hold_flag <> 'Y'
and requested_start_date <= sysdate;
select display_name
into disp_name
from wf_roles
where orig_system_id = in_system_id
and orig_system = in_system
and name = in_name;