The following lines contain the word 'select', 'insert', 'update' or 'delete':
P_LAST_UPDATE_DATE date;
P_UPDATED_BY_NAME varchar2(100);
P_LAST_UPDATE_DATE := null;
P_UPDATED_BY_NAME := null;
select mod (floor (minval/60), 60),
mod (floor (minval/3600), 24),
floor (minval/86400),
decode (pcode, 'R', decode (sign (actual_start_date + minval/86400
- sysdate),
-1, null,
to_char (
actual_start_date + minval/86400,
date_fmt)),
null)
into avg_mins,
avg_hrs,
avg_days,
expctd_finish
from fnd_conc_stat_summary,
fnd_concurrent_requests r,
fnd_concurrent_programs p
where request_id = reqid
and program_application_id = application_id
and p.concurrent_program_id = r.concurrent_program_id
and concurrent_program_name = program_name
and statistic# = -5
and daily = 'F'
and n > 0
and minval > 0;
l_updat_date_conv := date_text(P_LAST_UPDATE_DATE);
l_updat_date_conv := to_char(P_LAST_UPDATE_DATE, date_fmt_nongreg,
'NLS_CALENDAR='''||l_user_calendar||'''');
select count(*)
into pp_cnt
from fnd_conc_pp_actions
where concurrent_request_id = P_REQUEST_ID
and action_type = 6; -- REMOVE FOR PHASE 2
select processor_id, completed
into proc_id, complete
from fnd_conc_pp_actions
where concurrent_request_id = P_REQUEST_ID
and action_type = 6; -- REMOVE FOR PHASE 2
-- if processor_id has been updated, post-processing has begun
if proc_id is not null then
-- if completed != Y then the request is currently in post-processing
if complete <> 'Y' then
request_stats (P_REQUEST_ID, 'R', help_text);
select count(*)
into child_count
from fnd_concurrent_requests
where parent_request_id = P_REQUEST_ID
and phase_code in (PHASE_PENDING, PHASE_RUNNING);
l_updat_date_conv := date_text(P_LAST_UPDATE_DATE);
l_updat_date_conv := to_char(P_LAST_UPDATE_DATE, date_fmt_nongreg,
'NLS_CALENDAR='''||l_user_calendar||'''');
fnd_message.set_token('USER', P_UPDATED_BY_NAME);
select user_cd_name into cd_name from fnd_conflicts_domain
where cd_id = P_CD_ID;
select request_id
into ra_reqid
from fnd_concurrent_requests fcr, fnd_concurrent_programs fcp
where fcp.run_alone_flag = 'Y'
and fcp.concurrent_program_id = fcr.concurrent_program_id
and fcp.application_id = fcr.program_application_id
and fcr.phase_code = 'R'
and fcr.cd_id = P_CD_ID;
l_updat_date_conv := date_text(P_LAST_UPDATE_DATE);
l_updat_date_conv := to_char(P_LAST_UPDATE_DATE, date_fmt_nongreg,
'NLS_CALENDAR='''||l_user_calendar||'''');
fnd_message.set_token('USER', P_UPDATED_BY_NAME);
fnd_message.set_token('SUBMIT_DATE', date_text(P_LAST_UPDATE_DATE));
select count(*)
into cnt
from fnd_user fu, fnd_concurrent_requests fcr
where fcr.request_id = P_REQUEST_ID
and fu.user_id = fcr.requested_by
and (fu.end_date is null or fu.end_date > sysdate);
select count(*)
into parent_reqid
from fnd_concurrent_requests
where request_id = P_PARENT_REQUEST_ID
and phase_code in ('P', 'R');
l_updat_date_conv := date_text(P_LAST_UPDATE_DATE);
l_updat_date_conv := to_char(P_LAST_UPDATE_DATE, date_fmt_nongreg, 'NLS_CALENDAR='''||l_user_calendar||'''');
fnd_message.set_token('USER', P_UPDATED_BY_NAME);
fnd_message.set_name('FND', 'CONC-DG-COMPLETED DELETED');
fnd_message.set_token('USER', P_UPDATED_BY_NAME);
select property_value
into default_edition
from database_properties
where property_name = 'DEFAULT_EDITION';
select R.request_id, R.phase_code, R.status_code, R.request_date,
R.requested_start_date, R.hold_flag, R.parent_request_id,
R.last_update_date, U1.user_name updated_by_name,
R.actual_start_date, R.completion_text,
R.actual_completion_date, U2.user_name requestor,
FA.application_name application_name,
CP.enabled_flag enabled, R.controlling_manager,
Decode (R.Description,
NULL, CP.User_Concurrent_Program_Name,
R.Description||' ('||CP.User_Concurrent_Program_Name||')')
program_name, Queue_Control_Flag,
R.queue_method_code, CP.run_alone_flag,
R.single_thread_flag, R.request_limit, R.cd_id, R.edition_name
into P_REQUEST_ID, P_PHASE_CODE, P_STATUS_CODE, P_REQUEST_DATE,
P_REQUESTED_START_DATE, P_HOLD_FLAG, P_PARENT_REQUEST_ID,
P_LAST_UPDATE_DATE, P_UPDATED_BY_NAME,
P_ACTUAL_START_DATE, P_COMPLETION_TEXT,
P_ACTUAL_COMPLETION_DATE, P_REQUESTOR,
P_APPLICATION_NAME,
P_ENABLED, P_CONTROLLING_MANAGER,
P_PROGRAM, P_QUEUE_CONTROL_FLAG,
P_QUEUE_METHOD_CODE, P_RUN_ALONE_FLAG,
P_SINGLE_THREAD_FLAG, P_REQLIMIT_FLAG, P_CD_ID, P_EDITION_NAME
from fnd_concurrent_requests R, fnd_concurrent_programs_vl CP,
fnd_user U1, fnd_user U2,
fnd_application_vl FA
where R.request_id = diagnose.request_id
and R.program_application_id = FA.application_id
and R.program_application_id = CP.application_id (+)
and R.concurrent_program_id = CP.concurrent_program_id (+)
and R.last_updated_by = U1.user_id (+)
and R.requested_by = U2.user_id (+);
select queue_application_id, concurrent_queue_id
into appl_id, manager_id
from fnd_concurrent_processes
where concurrent_process_id = pid;
select max(concurrent_process_id)
into pid
from fnd_concurrent_processes
where concurrent_process_id in
(select concurrent_process_id
from fnd_concurrent_processes
where queue_application_id = 0
and concurrent_queue_id = 1
and process_status_code in ('A','M'));
select concurrent_process_id
from fnd_concurrent_processes
where concurrent_queue_id = qid
and queue_application_id = appid
and process_status_code in ('A', 'C');
select running_processes, max_processes,
concurrent_queue_id, queue_application_id,
decode(control_code,
'T','N', -- Abort
'X','N', -- Aborted
'D','N', -- Deactivate
'E','N', -- Deactivated
'Y') active
from fnd_concurrent_worker_requests
where request_id = rid
and not((queue_application_id = 0)
and (concurrent_queue_id in (1,4)));
select runalone_flag
into run_alone_flag
from fnd_conflicts_domain d
where d.cd_id = manager_check.cd_id;
select meaning into ret_value
from fnd_lookups
where lookup_type = ltype
and lookup_code = pcode;
select meaning into ret_value
from fnd_lookups
where lookup_type = ltype
and lookup_code = scode;
update fnd_concurrent_requests
set phase_code = 'C',
status_code = 'D',
completion_text = msg,
last_update_date = sysdate,
last_updated_by = fnd_global.user_id
where phase_code = 'P'
and edition_name > run_edition;