The following lines contain the word 'select', 'insert', 'update' or 'delete':
l_update_process varchar2(5);
select application_id, responsibility_id
from fnd_responsibility
where responsibility_key='SYSTEM_ADMINISTRATOR';
select user_id
from fnd_user
where user_name = 'SYSADMIN';
cursor csr_get_update_details is
select upgrade_definition_id,
upgrade_level,
upgrade_method
from pay_upgrade_definitions
where short_name = p_update_name;
select cr.phase_code dev_phase,
cr.status_code dev_status,
cr.request_id request_id
from fnd_concurrent_programs cp,
fnd_concurrent_requests cr,
fnd_application a
where a.application_short_name = p_app_shortname
and a.application_id = cp.application_id
and cp.concurrent_program_name = 'PAY_GEN_UPG'
and cp.concurrent_program_id = cr.concurrent_program_id
and cr.argument7 = to_char(p_business_group_id)
and cr.argument12 = 'UPG_DEF_NAME='||p_update_name
order by cr.request_date desc;
execute immediate l_sql_stmt using out l_update_process;
if l_update_process = 'TRUE' then
/*
** The update is required so submit a request for the SYSADMIN user using
** the System Administrator responsibility.
*/
/* Get the required IDs...
*/
open csr_get_user_details;
/* Get some details of the update being submitted to determine
** the correct submission mechanism.
*/
open csr_get_update_details;
fetch csr_get_update_details into l_upg_def_id, l_upg_lvl,
l_upg_mthd;
if csr_get_update_details%NOTFOUND then
hr_utility.set_message(800, 'PER_51775_UPD_NAME_NOT_FOUND');
close csr_get_update_details;
/* The update_name passed holds the name of the concurrent program
** to be submitted.
**
** First look to see if a request for this CP is waiting to run. If so
** then don't submit another one.
*/
l_return := fnd_concurrent.get_request_status(
request_id => l_request_id,
appl_shortname => p_app_shortname,
program => p_update_name,
phase => l_phase,
status => l_status,
dev_phase => l_dev_phase,
dev_status => l_dev_status,
message => l_message);
program => p_update_name,
argument1 => p_argument1,
argument2 => p_argument2,
argument3 => p_argument3,
argument4 => p_argument4,
argument5 => p_argument5,
argument6 => p_argument6,
argument7 => p_argument7,
argument8 => p_argument8,
argument9 => p_argument9,
argument10 => p_argument10);
/* The update is defined as a PYUGEN based update. Submit PYUGEN
** passing the name of the update.
**
** Check to see if a duplicate process is already running...
*/
open csr_get_conc_req_status;
argument11 => p_update_name, -- Short Name
argument12 => 'UPG_DEF_NAME='||p_update_name -- Upgrade Name
);
/* The update is not required for this customer. Set the status to
** indicate this. This is acheived by first setting the status to
** processing and then to complete due to validation within the GUP
** infrastructure code.
** Only do this if the process is not already at a Complete status.
*/
if isUpdateComplete(p_app_shortname,
NULL,
p_business_group_id,
p_update_name) = 'FALSE' then
setUpdateProcessing(p_update_name,
p_business_group_id,
p_legislation_code);
setUpdateComplete(p_update_name,
p_business_group_id,
p_legislation_code);
function isUpdateComplete
(p_app_shortname varchar2
,p_function_name varchar2
,p_business_group_id number
,p_update_name varchar2) return varchar2 is
l_status varchar2(20);
p_short_name => p_update_name,
p_status => l_status,
p_raise_error => FALSE
);
end isUpdateComplete;
procedure setUpdateProcessing
(p_update_name varchar2,
p_business_group_id number default null,
p_legislation_code varchar2 default null) is
cursor csr_get_update_details is
select upgrade_definition_id,
upgrade_level
from pay_upgrade_definitions
where short_name = p_update_name;
/* Get some details of the update being submitted to determine
** the correct submission mechanism.
*/
open csr_get_update_details;
fetch csr_get_update_details into l_upg_def_id, l_upg_lvl;
close csr_get_update_details;
end setUpdateProcessing;
procedure setUpdateComplete
(p_update_name varchar2,
p_business_group_id number default null,
p_legislation_code varchar2 default null) is
cursor csr_get_update_details is
select upgrade_definition_id,
upgrade_level
from pay_upgrade_definitions
where short_name = p_update_name;
/* Get some details of the update being submitted to determine
** the correct submission mechanism.
*/
open csr_get_update_details;
fetch csr_get_update_details into l_upg_def_id, l_upg_lvl;
close csr_get_update_details;
end setUpdateComplete;