The following lines contain the word 'select', 'insert', 'update' or 'delete':
select distinct
l.description longlang,
hd.language lang,
hd.title title,
hd.file_name fn
from fnd_help_documents hd,
fnd_languages_vl l
where hd.file_name = file
and hd.application = app
and l.language_code = hd.language
order by l.description;
select hd.file_id into fid
from fnd_help_documents hd
where hd.application = app
and hd.file_name = file
and hd.language = langcode
and rownum=1
and hd.custom_level =
(select max(hd2.custom_level)
from fnd_help_documents hd2
where hd2.file_name = hd.file_name
and hd2.language = hd.language
and hd2.application = hd.application);
select hd.file_id into fid
from fnd_help_documents hd
where hd.application = app
and hd.file_name = file
and hd.language = 'US'
and rownum=1
and hd.custom_level =
(select max(hd2.custom_level)
from fnd_help_documents hd2
where hd2.file_name = hd.file_name
and hd2.language = hd.language
and hd2.application = hd.application);
select distinct
l.description longlang,
hd.language lang,
hd.title title,
hd.file_name fn
from fnd_help_targets ht,
fnd_help_documents hd,
fnd_languages_vl l
where ht.file_id = hd.file_id
and ht.target_name = target
and hd.application = app
and l.language_code = hd.language
order by l.description;
select hd.file_id
from fnd_help_targets ht,
fnd_help_documents hd
where ht.file_id = hd.file_id
and ht.target_name = target
and hd.language = langcode
and hd.application = app
and hd.custom_level =
(select max(hd2.custom_level)
from fnd_help_documents hd2,
fnd_help_targets ht2
where ht2.target_name = ht.target_name
and ht2.file_id = hd2.file_id
and hd2.language = hd.language
and hd2.application = hd.application)
order by hd.file_id desc;
select lower(iso_language)||'-'||iso_territory
into httplang
from fnd_languages where language_code = langcode;
select userenv('language')
into language
from dual;
select ''''||nls_language||'''' into nlslang from fnd_languages
where language_code = langcode;
' (select /*+no_unnest*/ max(hd2.custom_level) '||
' from fnd_help_documents hd2 '||
' where hd2.file_name = hd.file_name '||
' and hd2.language = hd.language '||
' and hd2.application = hd.application) ';
update fnd_help_documents set
title = x_title,
version = x_version
where file_id = num_file_id;
insert into fnd_help_documents (
file_id,
language,
application,
file_name,
custom_level,
title,
version)
values (
num_file_id,
upper(x_language),
upper(x_application),
upper(x_file_name),
num_custom_level,
x_title,
x_version);
insert into fnd_help_targets (file_id, target_name)
values (num_file_id, upper(translate(x_target_name,'.','_')));
select file_id from fnd_help_documents
where upper(language) = upper(x_language)
and upper(application) = upper(x_application)
and upper(file_name) = upper(x_file_name)
and custom_level = num_custom_level
and file_id <> num_file_id;
delete from fnd_help_targets where file_id = f.file_id;
delete from fnd_lobs where file_id = f.file_id;
delete from fnd_help_documents where file_id = f.file_id;
delete from fnd_help_targets where file_id = x_file_id;
procedure delete_doc (
x_application in varchar2,
x_file_name in varchar2,
x_language in varchar2 default null,
x_custom_level in varchar2 default null)
is
num_custom_level number := to_number(x_custom_level);
select fhd.file_id
from fnd_help_documents fhd
where upper(fhd.application) = upper(x_application)
and upper(fhd.file_name) = upper(x_file_name)
and upper(fhd.language) = upper(nvl(x_language, fhd.language))
and fhd.custom_level = nvl(num_custom_level,
fhd.custom_level);
delete from fnd_help_targets fht
where fht.file_id = f.file_id;
delete from fnd_help_documents fhd
where fhd.file_id = f.file_id;
delete from fnd_lobs
where file_id = f.file_id;
end delete_doc;