The following lines contain the word 'select', 'insert', 'update' or 'delete':
select template_appl_short_name, template_code
into default_templ_shrt_name, default_templ_code
from fnd_concurrent_programs
where application_id = prog_app_id
and concurrent_program_name = conc_prog_name;
'select a.template_name, I.NAME||'': ''||T.territory_short_name, '||
' b.nls_language, x.language, x.territory, '||
' a.application_short_name, a.template_code, '||
' a.template_type_code, a.default_output_type '||
' from xdo_lobs x, xdo_templates_vl a, fnd_languages b, '||
' fnd_iso_languages_vl I, fnd_territories_vl T '||
' where a.ds_app_short_name = :prog_app_name '||
' and a.data_source_code = :conc_prog_name '||
' and a.template_code = x.lob_code '||
' and lower(x.language) = lower(:iso_lang) '||
' and lower(x.territory) = lower(:iso_terr) '||
' and b.nls_language = :nls_lang '||
' and lower(b.iso_language) = I.iso_language_2 '||
' and upper(x.territory) = T.territory_code '||
' and file_status = ''E'' '||
' and lob_type in (''TEMPLATE'',''MLS_TEMPLATE'') '||
' and (a.dependency_flag is NULL or a.dependency_flag = ''P'') '||
' and sysdate between a.start_date and nvl(a.end_date,sysdate) '||
' and rownum = 1 '
INTO template_name, template_language, request_language,
iso_language, iso_territory, template_app_name,
template_code, format_type, def_output_type
USING prog_app_name, conc_prog_name, iso_lang, iso_terr, nls_lang;
select a.template_name, I.NAME||': '||T.territory_short_name,
b.nls_language, x.language, x.territory,
a.application_short_name, a.template_code,
a.template_type_code
into template_name, template_language, request_language,
iso_language, iso_territory, template_app_name,
template_code, format_type
from xdo_lobs x, xdo_templates_vl a, fnd_languages b,
fnd_iso_languages_vl I, fnd_territories_vl T
where a.ds_app_short_name = prog_app_name
and a.data_source_code = conc_prog_name
and a.template_code = x.lob_code
and lower(x.language) = lower(iso_lang)
and lower(x.territory) = lower(iso_terr)
and b.nls_language = nls_lang
and lower(b.iso_language) = I.iso_language_2
and upper(x.territory) = T.territory_code
and file_status = 'E'
and lob_type in ('TEMPLATE','MLS_TEMPLATE')
and (a.dependency_flag is NULL or a.dependency_flag = 'P')
and sysdate between a.start_date and nvl(a.end_date,sysdate)
and rownum = 1;
'select a.template_name, I.NAME, '||
' b.nls_language, x.language, x.territory, '||
' a.application_short_name, a.template_code, '||
' a.template_type_code, a.default_output_type '||
' from xdo_lobs x, xdo_templates_vl a, fnd_languages b, '||
' fnd_iso_languages_vl I '||
' where a.ds_app_short_name = :prog_app_name '||
' and a.data_source_code = :conc_prog_name '||
' and a.template_code = x.lob_code '||
' and lower(x.language) = lower(:iso_lang) '||
' and lower(x.territory) = ''00'' '||
' and b.nls_language = :nls_lang '||
' and lower(b.iso_language) = I.iso_language_2 '||
' and file_status = ''E'' '||
' and lob_type in (''TEMPLATE'',''MLS_TEMPLATE'') '||
' and (a.dependency_flag is NULL or a.dependency_flag = ''P'') '||
' and sysdate between a.start_date and nvl(a.end_date,sysdate) '||
' and rownum = 1 '
INTO template_name, template_language, request_language,
iso_language, iso_territory, template_app_name,
template_code, format_type, def_output_type
USING prog_app_name, conc_prog_name, iso_lang, nls_lang;
select a.template_name, I.NAME,
b.nls_language, x.language, x.territory,
a.application_short_name, a.template_code,
a.template_type_code
into template_name, template_language, request_language,
iso_language, iso_territory, template_app_name,
template_code, format_type
from xdo_lobs x, xdo_templates_vl a, fnd_languages b,
fnd_iso_languages_vl I
where a.ds_app_short_name = prog_app_name
and a.data_source_code = conc_prog_name
and a.template_code = x.lob_code
and lower(x.language) = lower(iso_lang)
and lower(x.territory) = '00'
and b.nls_language = nls_lang
and lower(b.iso_language) = I.iso_language_2
and file_status = 'E'
and lob_type in ('TEMPLATE','MLS_TEMPLATE')
and (a.dependency_flag is NULL or a.dependency_flag = 'P')
and sysdate between a.start_date and nvl(a.end_date,sysdate)
and rownum = 1;
'select a.template_name, I.NAME||'': ''||T.territory_short_name, '||
' b.nls_language, x.language, x.territory, '||
' a.application_short_name, a.template_code, '||
' a.template_type_code, a.default_output_type '||
' from xdo_lobs x, xdo_templates_vl a, fnd_languages b, '||
' fnd_iso_languages_vl I, fnd_territories_vl T '||
' where a.ds_app_short_name = :prog_app_name '||
' and a.data_source_code = :conc_prog_name '||
' and a.template_code = :default_templ_code '||
' and a.template_code = x.lob_code '||
' and lower(x.language) = lower(:iso_lang) '||
' and lower(x.territory) = lower(:iso_terr) '||
' and b.nls_language = :nls_lang '||
' and lower(b.iso_language) = I.iso_language_2 '||
' and upper(x.territory) = T.territory_code '||
' and file_status = ''E'' '||
' and lob_type in (''TEMPLATE'',''MLS_TEMPLATE'') '||
' and (a.dependency_flag is NULL or a.dependency_flag = ''P'') '||
' and sysdate between a.start_date and nvl(a.end_date,sysdate) '||
' and rownum = 1 '
INTO template_name, template_language, request_language,
iso_language, iso_territory, template_app_name, template_code,
format_type, def_output_type
USING prog_app_name, conc_prog_name, default_templ_code, iso_lang,
iso_terr, nls_lang;
select a.template_name, I.NAME||': '||T.territory_short_name,
b.nls_language, x.language, x.territory,
a.application_short_name, a.template_code, a.template_type_code
into template_name, template_language, request_language,
iso_language, iso_territory, template_app_name, template_code,
format_type
from xdo_lobs x, xdo_templates_vl a, fnd_languages b,
fnd_iso_languages_vl I, fnd_territories_vl T
where a.ds_app_short_name = prog_app_name
and a.data_source_code = conc_prog_name
and a.template_code = default_templ_code
and a.template_code = x.lob_code
and lower(x.language) = lower(iso_lang)
and lower(x.territory) = lower(iso_terr)
and b.nls_language = nls_lang
and lower(b.iso_language) = I.iso_language_2
and upper(x.territory) = T.territory_code
and file_status = 'E'
and lob_type in ('TEMPLATE','MLS_TEMPLATE')
and (a.dependency_flag is NULL or a.dependency_flag = 'P')
and sysdate between a.start_date and nvl(a.end_date,sysdate)
and rownum = 1;
'select a.template_name, I.NAME, '||
' b.nls_language, x.language, x.territory, '||
' a.application_short_name, a.template_code, '||
' a.template_type_code, a.default_output_type '||
' from xdo_lobs x, xdo_templates_vl a, fnd_languages b, '||
' fnd_iso_languages_vl I '||
' where a.ds_app_short_name = :prog_app_name '||
' and a.data_source_code = :conc_prog_name '||
' and a.template_code = :default_templ_code '||
' and a.template_code = x.lob_code '||
' and lower(x.language) = lower(:iso_lang) '||
' and lower(x.territory) = ''00'' '||
' and b.nls_language = :nls_lang '||
' and lower(b.iso_language) = I.iso_language_2 '||
' and file_status = ''E'' '||
' and lob_type in (''TEMPLATE'',''MLS_TEMPLATE'') '||
' and (a.dependency_flag is NULL or a.dependency_flag = ''P'') '||
' and sysdate between a.start_date and nvl(a.end_date,sysdate) '||
' and rownum = 1 '
INTO template_name, template_language, request_language,
iso_language, iso_territory, template_app_name, template_code,
format_type, def_output_type
USING prog_app_name, conc_prog_name, default_templ_code, iso_lang,
nls_lang;
select a.template_name, I.NAME,
b.nls_language, x.language, x.territory,
a.application_short_name, a.template_code, a.template_type_code
into template_name, template_language, request_language,
iso_language, iso_territory, template_app_name, template_code,
format_type
from xdo_lobs x, xdo_templates_vl a, fnd_languages b,
fnd_iso_languages_vl I
where a.ds_app_short_name = prog_app_name
and a.data_source_code = conc_prog_name
and a.template_code = default_templ_code
and a.template_code = x.lob_code
and lower(x.language) = lower(iso_lang)
and lower(x.territory) = '00'
and b.nls_language = nls_lang
and lower(b.iso_language) = I.iso_language_2
and file_status = 'E'
and lob_type in ('TEMPLATE','MLS_TEMPLATE')
and (a.dependency_flag is NULL or a.dependency_flag = 'P')
and sysdate between a.start_date and nvl(a.end_date,sysdate)
and rownum = 1;
'select a.template_name, I.NAME, '||
' b.nls_language, x.language, x.territory, '||
' a.application_short_name, a.template_code, '||
' a.template_type_code, a.default_output_type '||
' from xdo_lobs x, xdo_templates_vl a, fnd_languages b, '||
' fnd_iso_languages_vl I '||
' where a.ds_app_short_name = :prog_app_name '||
' and a.data_source_code = :conc_prog_name '||
' and a.template_code = :default_templ_code '||
' and a.template_code = x.lob_code '||
' and lower(x.language) = lower(:iso_lang) '||
' and b.nls_language = :nls_lang '||
' and lower(b.iso_language) = I.iso_language_2 '||
' and file_status = ''E'' '||
' and lob_type in (''TEMPLATE'',''MLS_TEMPLATE'') '||
' and (a.dependency_flag is NULL or a.dependency_flag = ''P'') '||
' and sysdate between a.start_date and nvl(a.end_date,sysdate) '||
' and rownum = 1 '
INTO template_name, template_language, request_language,
iso_language, iso_territory, template_app_name, template_code,
format_type, def_output_type
USING prog_app_name, conc_prog_name, default_templ_code, iso_lang,
nls_lang;
select a.template_name, I.NAME,
b.nls_language, x.language, x.territory,
a.application_short_name, a.template_code, a.template_type_code
into template_name, template_language, request_language,
iso_language, iso_territory, template_app_name, template_code,
format_type
from xdo_lobs x, xdo_templates_vl a, fnd_languages b,
fnd_iso_languages_vl I
where a.ds_app_short_name = prog_app_name
and a.data_source_code = conc_prog_name
and a.template_code = default_templ_code
and a.template_code = x.lob_code
and lower(x.language) = lower(iso_lang)
and b.nls_language = nls_lang
and lower(b.iso_language) = I.iso_language_2
and file_status = 'E'
and lob_type in ('TEMPLATE','MLS_TEMPLATE')
and (a.dependency_flag is NULL or a.dependency_flag = 'P')
and sysdate between a.start_date and nvl(a.end_date,sysdate)
and rownum = 1;
'select a.template_name, I.NAME, '||
' b.nls_language, x.language, x.territory, '||
' a.application_short_name, a.template_code, '||
' a.template_type_code, a.default_output_type '||
' from xdo_lobs x, xdo_templates_vl a, fnd_languages b, '||
' fnd_iso_languages_vl I '||
' where a.ds_app_short_name = :prog_app_name '||
' and a.data_source_code = :conc_prog_name '||
' and a.template_code = x.lob_code '||
' and lower(x.language) = lower(:iso_lang) '||
' and b.nls_language = :nls_lang '||
' and lower(b.iso_language) = I.iso_language_2 '||
' and file_status = ''E'' '||
' and lob_type in (''TEMPLATE'',''MLS_TEMPLATE'') '||
' and (a.dependency_flag is NULL or a.dependency_flag = ''P'') '||
' and sysdate between a.start_date and nvl(a.end_date,sysdate) '||
' and rownum = 1 '
INTO template_name, template_language, request_language,
iso_language, iso_territory, template_app_name,
template_code, format_type, def_output_type
USING prog_app_name, conc_prog_name, iso_lang,
nls_lang;
select a.template_name, I.NAME,
b.nls_language, x.language, x.territory,
a.application_short_name, a.template_code,
a.template_type_code
into template_name, template_language, request_language,
iso_language, iso_territory, template_app_name,
template_code, format_type
from xdo_lobs x, xdo_templates_vl a, fnd_languages b,
fnd_iso_languages_vl I
where a.ds_app_short_name = prog_app_name
and a.data_source_code = conc_prog_name
and a.template_code = x.lob_code
and lower(x.language) = lower(iso_lang)
and b.nls_language = nls_lang
and lower(b.iso_language) = I.iso_language_2
and file_status = 'E'
and lob_type in ('TEMPLATE','MLS_TEMPLATE')
and (a.dependency_flag is NULL or a.dependency_flag = 'P')
and sysdate between a.start_date and nvl(a.end_date,sysdate)
and rownum = 1;
'select a.template_name, a.default_language, '||
' a.default_territory, a.application_short_name, '||
' a.template_code, a.template_type_code, '||
' a.default_output_type '||
' from xdo_lobs x, xdo_templates_vl a '||
' where a.ds_app_short_name = :template_app_name '||
' and a.data_source_code = :conc_prog_name '||
' and a.template_code = :default_templ_code '||
' and a.template_code = x.lob_code '||
' and file_status = ''E'' '||
' and lob_type in (''TEMPLATE'',''MLS_TEMPLATE'') '||
' and (a.dependency_flag is NULL or a.dependency_flag = ''P'') '||
' and sysdate between a.start_date and nvl(a.end_date,sysdate) '||
' and rownum = 1 '
INTO template_name, iso_language, iso_territory,
template_app_name, template_code, format_type,
def_output_type
USING template_app_name, conc_prog_name, default_templ_code;
select a.template_name, a.default_language, a.default_territory,
a.application_short_name, a.template_code,
a.template_type_code
into template_name, iso_language, iso_territory,
template_app_name, template_code, format_type
from xdo_lobs x, xdo_templates_vl a
where a.ds_app_short_name = template_app_name
and a.data_source_code = conc_prog_name
and a.template_code = default_templ_code
and a.template_code = x.lob_code
and file_status = 'E'
and lob_type in ('TEMPLATE','MLS_TEMPLATE')
and (a.dependency_flag is NULL or a.dependency_flag = 'P')
and sysdate between a.start_date and nvl(a.end_date,sysdate)
and rownum = 1;
'select x.template_name, a.default_language, '||
' a.default_territory, a.application_short_name, '||
' a.template_code, a.template_type_code, '||
' a.default_output_type '||
' from xdo_templates_b a, xdo_templates_vl x '||
' where a.ds_app_short_name = :prog_app_name '||
' and a.data_source_code = :conc_prog_name '||
' and a.template_code = x.template_code '||
' and a.template_status = ''E'' '||
' and (a.dependency_flag is NULL or a.dependency_flag = ''P'') '||
' and sysdate between a.start_date and nvl(a.end_date,sysdate) '||
' and rownum = 1 '
INTO template_name, iso_language, iso_territory, template_app_name,
template_code, format_type, def_output_type
USING prog_app_name, conc_prog_name;
select x.template_name, a.default_language, a.default_territory,
a.application_short_name, a.template_code,
a.template_type_code
into template_name, iso_language, iso_territory,
template_app_name, template_code, format_type
from xdo_templates_b a, xdo_templates_vl x
where a.ds_app_short_name = prog_app_name
and a.data_source_code = conc_prog_name
and a.template_code = x.template_code
and a.template_status = 'E'
and (a.dependency_flag is NULL or a.dependency_flag = 'P')
and sysdate between a.start_date and nvl(a.end_date,sysdate)
and rownum = 1;
'select x.template_name, a.default_language, '||
' a.default_territory, a.application_short_name, '||
' a.template_code, a.template_type_code, '||
' a.default_output_type '||
' from xdo_templates_b a, xdo_templates_vl x '||
' where a.ds_app_short_name = :prog_app_name '||
' and a.data_source_code = :conc_prog_name '||
' and a.template_code = :default_templ_code '||
' and a.template_code = x.template_code '||
' and a.template_status = ''E'' '||
' and (a.dependency_flag is NULL or a.dependency_flag = ''P'') '||
' and sysdate between a.start_date and nvl(a.end_date,sysdate) '||
' and rownum = 1 '
INTO template_name, iso_language, iso_territory, template_app_name,
template_code, format_type, def_output_type
USING prog_app_name, conc_prog_name, default_templ_code;
select x.template_name, a.default_language, a.default_territory,
a.application_short_name, a.template_code,
a.template_type_code
into template_name, iso_language, iso_territory,
template_app_name, template_code, format_type
from xdo_templates_b a, xdo_templates_vl x
where a.ds_app_short_name = prog_app_name
and a.data_source_code = conc_prog_name
and a.template_code = default_templ_code
and a.template_code = x.template_code
and a.template_status = 'E'
and (a.dependency_flag is NULL or a.dependency_flag = 'P')
and sysdate between a.start_date and nvl(a.end_date,sysdate)
and rownum = 1;
select I.name
into template_language
from fnd_iso_languages_vl I
where I.iso_language_2 = lower(iso_language);
select I.name||': '||T.territory_short_name
into template_language
from fnd_iso_languages_vl I, fnd_territories_vl T
where I.iso_language_2 = lower(iso_language)
and T.territory_code = upper(iso_territory);
select flv2.lookup_code
into format
from fnd_lookup_values_vl flv1, fnd_lookup_values_vl flv2
where flv1.lookup_type = 'XDO_TEMPLATE_TYPE'
and flv1.lookup_code = format_type
and flv2.lookup_type = flv1.tag;
SELECT lower(L1.iso_language), upper(L2.territory_code)
INTO iso_lang, iso_terr
FROM FND_LANGUAGES L1, FND_TERRITORIES_VL L2
WHERE L1.NLS_LANGUAGE = nls_lang
AND L2.NLS_TERRITORY = nls_terr
AND ROWNUM = 1;
SELECT upper(L2.territory_code)
INTO def_iso_terr
FROM FND_LANGUAGES L1, FND_TERRITORIES_VL L2
WHERE L1.NLS_LANGUAGE = nls_lang
AND L1.NLS_TERRITORY = L2.NLS_TERRITORY
AND ROWNUM = 1;
SELECT application_short_name, template_code
into new_t_app_name, new_template_code
from xdo_templates_vl T
where ds_app_short_name = prog_app_name
and data_source_code = conc_prog_name
and template_name = new_template_name;
select count(*) into xdo_columns_cntr from sys.all_tab_columns
where table_name in ('XDO_TEMPLATES_B', 'XDO_TEMPLATES_VL')
and column_name = 'DEFAULT_OUTPUT_TYPE';