The following lines contain the word 'select', 'insert', 'update' or 'delete':
FUNCTION lastupdate(snapshot_id__ INTEGER, patch_id__ INTEGER)
RETURN DATE IS
answ__ DATE;
select max(z.ts) into answ__
from
(select max(greatest(adts.snapshot_creation_date, adts.snapshot_update_date, adts.creation_date, adts.last_update_date)) ts
from ad_snapshots adts where adts.snapshot_id = snapshot_id__
UNION ALL
select max(greatest(umsts.last_update_date, umsts.last_definition_date)) ts
from fnd_ums_bugfixes umsts
where umsts.bug_number = (select bug_number from ad_pm_patches where patch_id = patch_id__) AND --ang
umsts.baseline = (select baseline from ad_pm_patches where patch_id = patch_id__) --ang
) z;
END lastupdate;
insert into fnd_imp_monitor(request_id, snapshot_id, set_type, virtual_bug_no,
virtual_patch_id, r1_requestor, r1_sync_date, r2_requestor, r2_sync_date, --ang
creation_date, last_update_date, last_updated_by, created_by)
values(request_id__, snapshot_id__, 'S', bug_no,
patch_id, request_id__, null, request_id__, null, sysdate, sysdate, -1, -1); --ang
insert into fnd_imp_bugset(request_id, snapshot_id, set_type, virtual_bug_no, bug_no, patch_order,
creation_date, last_update_date, last_updated_by, created_by)
values(request_id__, snapshot_id__, 'm', 0-bug_no__, prereq_bug_no,
patch_order, sysdate, sysdate, -1, -1);
delete from fnd_imp_bugset_temp;
delete from FND_IMP_PSMaster2 where patch_id = patch_id__ and snapshot_id = snapshot_id__; --ang
fnd_file.put_line(fnd_file.log, to_char(sysdate,'HH24:MI:SS')||'> after delete');
insert into fnd_imp_bugset_temp(patch_id)
(select q1.patch_id from fnd_imp_bugset q1
where q1.request_id = request_id__ and q1.snapshot_id = snapshot_id__
and q1.virtual_patch_id = virtual_patch_id__ and q1.set_type IN ('M','m','A'));
fnd_file.put_line(fnd_file.log, to_char(sysdate,'HH24:MI:SS')||'> after insert into fnd_imp_bugset_temp');
INSERT INTO FND_IMP_PSMASTER2(PATCH_ID, SNAPSHOT_ID, APP_SHORT_NAME,
DIRECTORY, FILENAME, TYPEID, NEW_VERSION, OLD_VERSION, FILES_AFFECTED, TYPE_AFFECTED, FILE_TYPE, TRANS_NAME, IS_FLAGGED_FILE)
SELECT virtual_patch_id__ PATCH_ID, snapshot_id__ SNAPSHOT_ID, APP_SHORT_NAME,
DIRECTORY, FILENAME, MAX(TYPEID), MAX(NEW_VERSION), MAX(OLD_VERSION),
MAX(FILES_AFFECTED), MAX(TYPE_AFFECTED), MAX(FILE_TYPE), MAX(TRANS_NAME),MAX(IS_FLAGGED_FILE)
FROM
FND_IMP_PSMASTER2 M
WHERE
M.SNAPSHOT_ID = snapshot_id__
AND M.PATCH_ID IN ( SELECT PATCH_ID FROM FND_IMP_BUGSET_TEMP)
AND NOT EXISTS (
SELECT /*+ INDEX(X FND_IMP_PSMASTER2_N1) */ 1
FROM FND_IMP_PSMASTER2 X
WHERE X.SNAPSHOT_ID = snapshot_id__
AND X.PATCH_ID IN (SELECT PATCH_ID FROM FND_IMP_BUGSET_TEMP where PATCH_ID <> M.PATCH_ID)
AND X.APP_SHORT_NAME = M.APP_SHORT_NAME
AND X.DIRECTORY = M.DIRECTORY
AND X.FILENAME = M.FILENAME
and X.NEW_VERSION IS NOT NULL
AND ( ( M.NEW_VERSION IS NULL)
or ( M.NEW_VERSION IS NOT NULL AND FND_IMP_CONV_PKG.COMPARE_RCSID(M.NEW_VERSION, X.NEW_VERSION) IN (1, 2)) ) )
GROUP BY APP_SHORT_NAME, DIRECTORY,FILENAME;
fnd_file.put_line(fnd_file.log, to_char(sysdate,'HH24:MI:SS')||'> after insert into fnd_imp_psmaster2');
select virtual_patch_id, r1_requestor --ang
from fnd_imp_monitor
where r1_requestor IS NOT NULL and request_id <> r1_requestor
and psmaster2_sz <> 0 and request_id = request_id__;
select virtual_patch_id, r2_requestor --ang
from fnd_imp_monitor
where r2_requestor IS NOT NULL and request_id <> r2_requestor
and psmaster2_sz <> 0 and request_id = request_id__;
select snapshot_id, virtual_patch_id, set_type --ang
from fnd_imp_monitor
where request_id = request_id__ and
((set_type IN ('M', 'S', 's') and r1_sync_date IS NULL)
or psmaster2_sz = 0)
order by snapshot_id, set_type desc, virtual_patch_id;
delete from fnd_imp_monitor where request_id = request_id__;
delete from fnd_imp_bugset where request_id = request_id__ and set_type <> 'A';
insert into fnd_imp_bugset(request_id, snapshot_id, set_type, virtual_bug_no, bug_no,
creation_date, last_update_date, last_updated_by, created_by)
select request_id__, s.snapshot_id, 'M', s.virtual_bug_no, 0-s.virtual_bug_no, sysdate, sysdate, -1, -1
from fnd_imp_bugset s
where s.request_id = request_id__
group by s.snapshot_id, s.virtual_bug_no;
insert into fnd_imp_monitor(request_id, snapshot_id, set_type, virtual_bug_no,
r1_requestor, r1_sync_date, r2_requestor, r2_sync_date,
creation_date, last_update_date, last_updated_by, created_by)
select request_id__, s.snapshot_id, 'M' set_type, s.virtual_bug_no,
request_id__, null, request_id__, null, sysdate, sysdate, -1, -1
from fnd_imp_bugset s
where s.request_id = request_id__ and set_type = 'M';
insert into fnd_imp_monitor(request_id, snapshot_id, set_type, virtual_bug_no,
r1_requestor, r1_sync_date, r2_requestor, r2_sync_date,
creation_date, last_update_date, last_updated_by, created_by)
select request_id__, s.snapshot_id, 's' set_type, s.bug_no virtual_bug_no,
request_id__, null, request_id__, null, sysdate, sysdate, -1, -1
from fnd_imp_bugset s
where s.request_id = request_id__
and s.set_type = 'm'
and s.bug_no NOT IN(select m.virtual_bug_no from fnd_imp_monitor m where m.request_id = request_id__)
group by s.snapshot_id, s.bug_no;
update fnd_imp_monitor x
set
r1_requestor =
(select DECODE(stage__,'1',n.r1_requestor,n.r2_requestor)
from fnd_imp_monitor n
where n.request_id IS NULL
--and n.snapshot_id = x.snapshot_id and n.virtual_bug_no = x.virtual_bug_no), --ang
and n.snapshot_id = x.snapshot_id and n.virtual_patch_id = x.virtual_patch_id), --ang
r1_sync_date =
(select DECODE(stage__,'1',n.r1_sync_date,n.r2_sync_date)
from fnd_imp_monitor n
where n.request_id IS NULL
--and n.snapshot_id = x.snapshot_id and n.virtual_bug_no = x.virtual_bug_no), --ang
and n.snapshot_id = x.snapshot_id and n.virtual_patch_id = x.virtual_patch_id), --ang
psmaster2_sz =
(select n.psmaster2_sz
from fnd_imp_monitor n
where n.request_id IS NULL
--and n.snapshot_id = x.snapshot_id and n.virtual_bug_no = x.virtual_bug_no) --ang
and n.snapshot_id = x.snapshot_id and n.virtual_patch_id = x.virtual_patch_id) --ang
where x.request_id = request_id__
and EXISTS (
select 1 from fnd_imp_monitor m
where
m.request_id IS NULL
--and m.snapshot_id = x.snapshot_id and m.virtual_bug_no = x.virtual_bug_no --ang
and m.snapshot_id = x.snapshot_id and m.virtual_patch_id = x.virtual_patch_id
--and DECODE(stage__,'1',m.r1_sync_date,m.r2_sync_date) >= lastupdate(x.snapshot_id, x.virtual_bug_no) --ang
and DECODE(stage__,'1',m.r1_sync_date,m.r2_sync_date) >= lastupdate(x.snapshot_id, x.virtual_patch_id) --ang
);
select sysdate into time__ from dual;
select count(*) into psmaster2_sz__
from fnd_imp_psmaster2
where snapshot_id = snapshot_id__
and patch_id = virtual_patch_id__;
delete from fnd_imp_monitor
where request_id IS NULL and snapshot_id = snapshot_id__ and virtual_patch_id = virtual_patch_id__;
insert into fnd_imp_monitor(request_id, snapshot_id, set_type, virtual_patch_id,
r1_requestor, r1_sync_date, r2_requestor, r2_sync_date, psmaster2_sz,
creation_date, last_update_date, last_updated_by, created_by)
values(NULL, snapshot_id__, set_type__, virtual_patch_id__,
request_id__, time__, request_id__, null, psmaster2_sz__,
sysdate, sysdate, -1, -1);
update fnd_imp_monitor set set_type = 'S'
where request_id IS NULL and snapshot_id = snapshot_id__
and set_type = 's' and virtual_patch_id = 0-virtual_patch_id__;
update fnd_imp_monitor set r1_sync_date = time__, last_update_date = time__, psmaster2_sz = psmaster2_sz__
where request_id = request_id__ and snapshot_id = snapshot_id__
and set_type = set_type__ and virtual_patch_id = virtual_patch_id__;
select snapshot_id, virtual_patch_id, set_type, psmaster2_sz
from fnd_imp_monitor
where request_id = request_id__ and
((set_type IN ('M', 'S', 's') and r2_sync_date IS NULL)
or psmaster2_sz = 0)
order by snapshot_id, set_type desc, virtual_patch_id;
update fnd_imp_monitor x
set
r2_requestor =
(select DECODE(stage__,'1',n.r1_requestor,n.r2_requestor)
from fnd_imp_monitor n
where n.request_id IS NULL
and n.snapshot_id = x.snapshot_id and n.virtual_patch_id = x.virtual_patch_id),
r2_sync_date =
(select DECODE(stage__,'1',n.r1_sync_date,n.r2_sync_date)
from fnd_imp_monitor n
where n.request_id IS NULL
and n.snapshot_id = x.snapshot_id and n.virtual_patch_id = x.virtual_patch_id)
where x.request_id = request_id__
and EXISTS (
select 1 from fnd_imp_monitor m
where
m.request_id IS NULL
and m.snapshot_id = x.snapshot_id and m.virtual_patch_id = x.virtual_patch_id
and DECODE(stage__,'1',m.r1_sync_date,m.r2_sync_date) >= lastupdate(x.snapshot_id, x.virtual_patch_id)
);
select sysdate into time__ from dual;
update fnd_imp_monitor set r2_requestor = request_id__, r2_sync_date = time__, last_update_date = time__
where request_id IS NULL and snapshot_id = snapshot_id__
and set_type = set_type__ and virtual_patch_id = virtual_patch_id__;
update fnd_imp_monitor set r2_sync_date = time__, last_update_date = time__
where request_id = request_id__ and snapshot_id = snapshot_id__
and set_type = set_type__ and virtual_patch_id = virtual_patch_id__;
update fnd_imp_bugset
set set_type = 'a'
where request_id = request_id__
and virtual_patch_id = 0-request_id__;
select 'Y' into is_running__
from fnd_imp_bugset
where request_id = request_id__
and virtual_bug_no = 0-request_id__
and set_type = 'A'
and rownum = 1;
select patch_id
from fnd_imp_bugset
where virtual_patch_id = 0-request_id__ and request_id = request_id__
and set_type = 'a' and patch_order = 1;
delete from fnd_imp_bugset
where request_id = request_id__ and (set_type = 'A' or set_type = 'a') and snapshot_id = snapshot_id__;
insert into fnd_imp_bugset(request_id, snapshot_id, set_type, virtual_bug_no, bug_no, patch_order,
creation_date, last_update_date, last_updated_by, created_by)
values(request_id__, snapshot_id__, 'A', 0-request_id__, bug_no,
1, sysdate, sysdate, -1, -1);
delete from fnd_imp_bugset
where request_id = request_id__ and (set_type = 'A' or set_type = 'a') and snapshot_id = snapshot_id__;
insert into fnd_imp_bugset(request_id, snapshot_id, set_type, virtual_patch_id, patch_id, patch_order,
creation_date, last_update_date, last_updated_by, created_by)
values(request_id__, snapshot_id__, 'A', 0-request_id__, patch_id,
1, sysdate, sysdate, -1, -1);
select bug_no
from fnd_imp_bugset
where set_type = 'A' and patch_order = 1 and request_id = request_id__;
insert into fnd_imp_bugset(request_id, snapshot_id, set_type, virtual_bug_no, bug_no, patch_order,
creation_date, last_update_date, last_updated_by, created_by)
values(request_id__, snapshot_id__, 'A', 0-request_id__, prereq_bug_no,
2, sysdate, sysdate, -1, -1);
SELECT COUNT(*) INTO cnt FROM fnd_imp_monitor where request_id IS NULL and snapshot_id = snapshot_id__ and virtual_patch_id = patch_id__;
delete from fnd_imp_monitor where request_id IS NULL and snapshot_id = snapshot_id__ and virtual_patch_id = patch_id__; commit;
SELECT COUNT(*) INTO cnt from FND_IMP_PFileInfo where patch_id = patch_id__;
delete from FND_IMP_PFileInfo where patch_id = patch_id__; commit;
SELECT COUNT(*) INTO cnt from FND_IMP_PFileInfo2 where patch_id = patch_id__;
delete from FND_IMP_PFileInfo2 where patch_id = patch_id__; commit;
SELECT COUNT(*) INTO cnt from FND_IMP_PSCommon where patch_id = patch_id__ and snapshot_id = snapshot_id__;
delete from FND_IMP_PSCommon where patch_id = patch_id__ and snapshot_id = snapshot_id__; commit;
SELECT COUNT(*) INTO cnt from FND_IMP_PSNew where patch_id = patch_id__ and snapshot_id = snapshot_id__;
delete from FND_IMP_PSNew where patch_id = patch_id__ and snapshot_id = snapshot_id__; commit;
SELECT COUNT(*) INTO cnt from fnd_imp_menu_dep_summary2 where patch_id = patch_id__ and snapshot_id = snapshot_id__;
delete from fnd_imp_menu_dep_summary2 where patch_id = patch_id__ and snapshot_id = snapshot_id__;
SELECT COUNT(*) INTO cnt from fnd_imp_menu_dep_summary3 where patch_id = patch_id__ and snapshot_id = snapshot_id__;
delete from fnd_imp_menu_dep_summary3 where patch_id = patch_id__ and snapshot_id = snapshot_id__;
SELECT COUNT(*) INTO cnt from FND_IMP_PISummary where patch_id = patch_id__ and snapshot_id = snapshot_id__;
delete from FND_IMP_PISummary where patch_id = patch_id__ and snapshot_id = snapshot_id__;
SELECT COUNT(*) INTO cnt from FND_IMP_PSMaster2 where patch_id = patch_id__ and snapshot_id = snapshot_id__;
delete from FND_IMP_PSMaster2 where patch_id = patch_id__ and snapshot_id = snapshot_id__;
SELECT COUNT(*) INTO cnt from FND_IMP_AffectedFiles where patch_id = patch_id__ and snapshot_id = snapshot_id__;
delete from FND_IMP_AffectedFiles where patch_id = patch_id__ and snapshot_id = snapshot_id__;
SELECT COUNT(*) INTO cnt from FND_IMP_DiagMap where patch_id = patch_id__ and snapshot_id = snapshot_id__;
delete from FND_IMP_DiagMap where patch_id = patch_id__ and snapshot_id = snapshot_id__;
delete from FND_IMP_PFileInfo where patch_id = patch_id__; commit; --ang
delete from FND_IMP_PFileInfo2 where patch_id = patch_id__; commit;
delete from FND_IMP_PSCommon where patch_id = patch_id__ and snapshot_id = snapshot_id__; commit;
delete from FND_IMP_PSNew where patch_id = patch_id__ and snapshot_id = snapshot_id__; commit;
insert into FND_IMP_PFileInfo (select * from FND_IMP_PFileInfo_VL where patch_id = patch_id__); commit;
insert into FND_IMP_PFileInfo2 (select * from FND_IMP_PFileInfo2_VL where patch_id = patch_id__); commit;
insert into FND_IMP_PSCommon (select * from FND_IMP_PSCommon_VL where patch_id = patch_id__ and snapshot_id = snapshot_id__); commit;
insert into FND_IMP_PSNew (select * from FND_IMP_PSNew_VL where patch_id = patch_id__ and snapshot_id = snapshot_id__); commit;
delete from FND_IMP_PSMaster2 where patch_id = patch_id__ and snapshot_id = snapshot_id__;
insert into FND_IMP_PSMaster2 (select * from FND_IMP_PSMaster2_VL where patch_id = patch_id__ and snapshot_id = snapshot_id__);
insert into FND_IMP_AffectedFiles (select * from FND_IMP_AffectedFiles_VL where bug_no = bug_no__ and snapshot_id = snapshot_id__);
insert into FND_IMP_DiagMap (select * from FND_IMP_DiagMap_VL where bug_no = bug_no__ and snapshot_id = snapshot_id__);
delete from FND_IMP_AffectedFiles where patch_id = patch_id__ and snapshot_id = snapshot_id__;
delete from FND_IMP_DiagMap where patch_id = patch_id__ and snapshot_id = snapshot_id__;
delete from fnd_imp_menu_dep_summary2 where patch_id = patch_id__ and snapshot_id = snapshot_id__;
delete from fnd_imp_menu_dep_summary3 where patch_id = patch_id__ and snapshot_id = snapshot_id__;
delete from FND_IMP_PISummary where patch_id = patch_id__ and snapshot_id = snapshot_id__;
insert into FND_IMP_AffectedFiles (select * from FND_IMP_AffectedFiles_VL where patch_id = patch_id__ and snapshot_id = snapshot_id__);
insert into FND_IMP_DiagMap (select * from FND_IMP_DiagMap_VL where patch_id = patch_id__ and snapshot_id = snapshot_id__);
insert into fnd_imp_menu_dep_summary2 (select * from fnd_imp_menu_dep_summary2_vl where patch_id = patch_id__ and snapshot_id = snapshot_id__);
insert into fnd_imp_menu_dep_summary3 (select * from fnd_imp_menu_dep_summary3_vl where patch_id = patch_id__ and snapshot_id = snapshot_id__);
insert into FND_IMP_PISummary
(select * from FND_IMP_PISummary_VL
where patch_id = patch_id__ and snapshot_id = snapshot_id__);
update fnd_imp_psmaster2 p
set files_affected =
(
select count(*)
from fnd_imp_affectedfiles f
where p.patch_id = f.patch_id
and p.snapshot_id = f.snapshot_id
and p.app_short_name = f.patched_app_short_name
and p.directory = f.patched_directory
and p.filename = f.patched_filename
)
where patch_id=patch_id__
and snapshot_id=snapshot_id__
and typeid <> 'not applied'
and file_type = 'jsp';
update fnd_imp_psmaster2
set type_affected='jsp'
where patch_id=patch_id__
and snapshot_id=snapshot_id__
and typeid <> 'not applied'
and files_affected<>0
and file_type = 'jsp';
update fnd_imp_psmaster2 p
set files_affected=(select count(*)
from fnd_imp_menu_dep_summary2 s
where p.patch_id=s.patch_id
and p.snapshot_id=s.snapshot_id
and p.filename=s.form_name)
where patch_id=patch_id__
and snapshot_id=snapshot_id__
and typeid <> 'not applied'
and file_type = 'fmb';
update fnd_imp_psmaster2 p
set type_affected='menu'
where patch_id=patch_id__
and snapshot_id=snapshot_id__
and typeid <> 'not applied'
and file_type = 'fmb'
and files_affected <> 0;
update fnd_imp_psmaster2 p
set files_affected=(select count(*)
from jtf_diagnostic_cmap s
where p.trans_name=s.classname)
where patch_id=patch_id__
and snapshot_id=snapshot_id__
and typeid <> 'not applied'
and file_type = 'class';
update fnd_imp_psmaster2 p
set type_affected='diag'
where patch_id=patch_id__
and snapshot_id=snapshot_id__
and typeid <> 'not applied'
and file_type = 'class'
and files_affected <> 0;
update fnd_imp_affectedfiles p
set objects_affected=(select count(*)
from fnd_imp_menu_dep_summary2 s
where p.patch_id=s.patch_id
and p.snapshot_id=s.snapshot_id
and p.dep_filename=s.form_name)
where patch_id=patch_id__
and snapshot_id=snapshot_id__
and typeid <> 'not applied';
update fnd_imp_affectedfiles p
set object_type='menu'
where patch_id=patch_id__
and snapshot_id=snapshot_id__
and typeid <> 'not applied'
and objects_affected <> 0;
select virtual_bug_no
from fnd_imp_monitor
where set_type in ('s','S')
and request_id = v_req_id
and snapshot_id = v_snapshot_id;
select virtual_patch_id
from fnd_imp_monitor
where set_type = 'M'
and request_id = v_req_id
and snapshot_id = v_snapshot_id;
delete from fnd_imp_lang_summary l
where l.snapshot_id = snapshot_id__
and patch_id in (
select m.virtual_patch_id
from fnd_imp_monitor m
where m.set_type in ('s','S','M')
and m.request_id = request_id__
and m.snapshot_id = l.snapshot_id
union
select 0-request_id__ from dual);
select decode(count(fcv.file_type),0,0,1) into v_req_trans
from fnd_imp_filetypecount_vl fcv
where lower(fcv.file_type) in
--('fmb','fmx','rdf','ldt','ildt','jtl','msg','msb','res')
(select lower(lu.lookup_code) from fnd_lookups lu
where lu.lookup_type = 'OAM_PIA_TRANS_FILE_TYPES')
and ( fcv.upgrade > 0 or fcv.new > 0 )
and fcv.snapshot_id = snapshot_id__
and fcv.bug_no = v_bug.virtual_bug_no;
insert into fnd_imp_lang_summary (
snapshot_id, patch_id, req_trans_cnt) values
(snapshot_id__, v_bug.virtual_bug_no, v_req_trans);
select sum(req_trans_cnt) into v_req_trans from
( -- get all the prequisites
select ls.req_trans_cnt req_trans_cnt
from fnd_imp_bugset b, fnd_imp_lang_summary ls
where ls.patch_id = b.patch_id
and ls.snapshot_id = b.snapshot_id
and b.virtual_patch_id = v_bug.virtual_patch_id
and b.set_type = 'm'
and b.snapshot_id = snapshot_id__
union all
-- combine with the top level
select ls.req_trans_cnt req_trans_cnt
from fnd_imp_lang_summary ls
where ls.patch_id = (0 - v_bug.virtual_patch_id)
);
insert into fnd_imp_lang_summary (
snapshot_id, patch_id, req_trans_cnt) values
(snapshot_id__, v_bug.virtual_patch_id, v_req_trans);
select sum(ls.req_trans_cnt) into v_req_trans
from fnd_imp_bugset b, fnd_imp_lang_summary ls
where ls.patch_id = b.patch_id
and ls.snapshot_id = b.snapshot_id
and b.virtual_patch_id = (0-request_id__)
and b.set_type = 'a'
and b.snapshot_id = snapshot_id__
group by b.virtual_patch_id;
insert into fnd_imp_lang_summary (
snapshot_id, patch_id, req_trans_cnt) values
(snapshot_id__, (0-request_id__), v_req_trans);
select fcr.request_id into request_id
from fnd_application fa, fnd_concurrent_requests fcr, fnd_concurrent_programs fcp
where fcr.priority_request_id = fnd_global.conc_priority_request
and fcr.program_application_id = fcp.application_id
and fcp.application_id = fa.application_id
and fcr.concurrent_program_id = fcp.concurrent_program_id
and fa.application_short_name = 'AD'
and fcp.concurrent_program_name IN ('PATCHANALYSIS', 'PAANALYSIS', 'PADOWNLOADPATCHES', 'PAANALYZEPATCHES', 'PARECOMMENDPATCHES');
select fcr.request_id into request_id
from fnd_application fa, fnd_concurrent_requests fcr, fnd_concurrent_programs fcp
where fcr.priority_request_id = fnd_global.conc_priority_request
and fcr.program_application_id = fcp.application_id
and fcp.application_id = fa.application_id
and fcr.concurrent_program_id = fcp.concurrent_program_id
and fa.application_short_name = 'AD'
and fcp.concurrent_program_name IN ('PATCHANALYSIS', 'PAANALYSIS', 'PADOWNLOADPATCHES', 'PAANALYZEPATCHES', 'PARECOMMENDPATCHES');
select fcr.request_id into request_id
from fnd_application fa, fnd_concurrent_requests fcr, fnd_concurrent_programs fcp
where fcr.priority_request_id = fnd_global.conc_priority_request
and fcr.program_application_id = fcp.application_id
and fcp.application_id = fa.application_id
and fcr.concurrent_program_id = fcp.concurrent_program_id
and fa.application_short_name = 'AD'
and fcp.concurrent_program_name IN ('PATCHANALYSIS', 'PAANALYSIS', 'PADOWNLOADPATCHES', 'PAANALYZEPATCHES', 'PARECOMMENDPATCHES');
execute immediate 'insert into '||table_name||' (select * from '||table_name||'_VL)';
select virtual_bug_no
from fnd_imp_monitor
where set_type in ('s','S')
and request_id = v_req_id
and snapshot_id = v_snapshot_id;
select 'Y' into v_return
from fnd_imp_filetypecount_vl fcv
where lower(fcv.file_type) = lower(filetype__)
and ( fcv.upgrade > 0 or fcv.new > 0 )
and fcv.snapshot_id = snapshot_id__
and fcv.bug_no = v_bug.virtual_bug_no;