The following lines contain the word 'select', 'insert', 'update' or 'delete':
execute immediate 'select count(*) from fnd_databases' into cnt;
select substr(machine, 1,
decode(instr(machine, '.', 1, 1),
0, length(machine),
instr(machine, '.', 1, 1)-1))
into primary_node
from v$session
where audsid=USERENV('SESSIONID');
select NVL(serial_number, 0), version into db_sr_num, db_ver_str
from fnd_oam_context_files
where (node_name = primary_node
and path = filepath
and name not in ('METADATA','TEMPLATE')
and (status is null or upper(status) in ('S','F')))
or (path = filepath
and name in ( 'METADATA', 'TEMPLATE'))
for update;
insert into fnd_oam_context_files
(name, version, path, last_synchronized,
text, creation_date, created_by, last_update_date,
last_updated_by, last_update_login, node_name,
status, ctx_type)
values (context_name, file_ver, filepath, sysdate,
ctx_file_clob, sysdate, FND_GLOBAL.user_id, sysdate,
FND_GLOBAL.user_id, FND_GLOBAL.login_id, primary_node,
'S',
DECODE(context_type, 'APPS', 'A', 'DATABASE','D','A'));
update fnd_oam_context_files
set path = filepath,
last_synchronized = sysdate,
text = ctx_file_clob,
last_update_date = sysdate,
last_updated_by = fnd_global.user_id,
last_update_login = fnd_global.login_id,
node_name = primary_node,
version = file_ver,
status = 'S'
where (node_name = primary_node
and path = filepath
and name not in ('METADATA', 'TEMPLATE')
and (status is null or upper(status) in ('S','F')))
or (path = filepath
and name in ( 'METADATA', 'TEMPLATE'));
select substr(value,1,8) into db_name
from v$parameter where name='db_name';
select substr(value,1,255) into db_domain
from v$parameter where name='db_domain';
select instance_number,instance_name
into inst_num, inst_name
from v$instance;
select concurrent_queue_id, application_id, enabled_flag
into queue_id, queue_appl_id, fcq_enabled_flag
from fnd_concurrent_queues
where application_id = 0
and concurrent_queue_name = short_name;
/* Update the workshift parameters. */
update fnd_concurrent_queue_size
set service_parameters = parameters
where concurrent_queue_id = queue_id
and queue_application_id = queue_appl_id;
/* Now update enabled flag to 'N' */
select concurrent_queue_id, application_id, enabled_flag
into queue_id, queue_appl_id, fcq_enabled_flag
from fnd_concurrent_queues
where application_id = 0
and concurrent_queue_name = short_name;
update fnd_concurrent_queues
set enabled_flag = 'N'
where concurrent_queue_id = queue_id
and application_id = queue_appl_id;
/* Update fcq if necessary */
update fnd_concurrent_queues
set enabled_flag = 'N'
where application_id = 0
and concurrent_queue_name = short_name;