The following lines contain the word 'select', 'insert', 'update' or 'delete':
p_select varchar2(2000);
select terr_id, wf_notification.substitutespecialchars(name) name,
wf_notification.substitutespecialchars(terr_type_name) terr_type_name, rank,
trunc(creation_date) creation_date, trunc(last_update_date) last_update_date
from jtf_terr_overview_v
where last_update_date >= c_from_date --'01-OCT-2001'
and last_update_date <= c_to_date; --'11-JUN-1997'
select resource_id, resource_id || ': Rsc Name Not Available' resource_name
from jtf_terr_rsc where terr_id = ci_terr_id;
select distinct resource_id, wf_notification.substitutespecialchars(resource_name) resource_name
from jtf_terr_resources_v jtrv
where jtrv.terr_id = ci_terr_id
order by resource_name;
SELECT distinct TERR_QUAL_ID,
TERR_ID,
QUAL_USG_ID,
ORG_ID,
wf_notification.substitutespecialchars(qualifier_name) qualifier_name
FROM jtf_terr_qualifiers_v
WHERE terr_id = p_template_terr_id;
SELECT j1.TERR_VALUE_ID
, wf_notification.substitutespecialchars(j1.COMPARISON_OPERATOR) COMPARISON_OPERATOR
, wf_notification.substitutespecialchars(j1.LOW_VALUE_CHAR_DESC) LOW_VALUE_CHAR_DESC
, wf_notification.substitutespecialchars(j1.HIGH_VALUE_CHAR_DESC) HIGH_VALUE_CHAR_DESC
, j1.LOW_VALUE_NUMBER
, j1.HIGH_VALUE_NUMBER
, wf_notification.substitutespecialchars(j1.INTEREST_TYPE) INTEREST_TYPE
, wf_notification.substitutespecialchars(j1.PRIMARY_INTEREST_CODE) PRIMARY_INTEREST_CODE
, wf_notification.substitutespecialchars(j1.SECONDARY_INTEREST_CODE) SECONDARY_INTEREST_CODE
, wf_notification.substitutespecialchars(j1.CURRENCY_CODE) CURRENCY_CODE
, j1.LOW_VALUE_CHAR_ID
, wf_notification.substitutespecialchars(DISPLAY_TYPE) DISPLAY_TYPE
, wf_notification.substitutespecialchars(CONVERT_TO_ID_FLAG) CONVERT_TO_ID_FLAG
FROM jtf_terr_values_desc_v j1
WHERE j1.terr_qual_id = p_terr_qual_id
ORDER BY j1.value_set;
select trunc(to_date(p_sd_date||'-'||p_sm_date||'-'||p_sy_date,'DD/MM/YYYY'))
into l_from_date
from dual;
select trunc(to_date(p_ed_date||'-'||p_em_date||'-'||p_ey_date,'DD/MM/YYYY'))
into l_to_date
from dual;
htp.p('Updated: ' ||rec_terr.last_update_date);
htp.p('Created/Updates ');
htp.p(rec_territory.name||'/' ||rec_territory.terr_id || ' - ' || rec_territory.last_update_date);
select terr_id, wf_notification.substitutespecialchars(name) name,
wf_notification.substitutespecialchars(terr_type_name) terr_type_name, rank,
trunc(creation_date) creation_date, trunc(last_update_date) last_update_date
from jtf_terr_overview_v
where last_update_date >= c_from_date --'01-OCT-2001'
and last_update_date <= c_to_date; --'11-JUN-1997'
select distinct resource_id, wf_notification.substitutespecialchars(resource_name) resource_name
from jtf_terr_resources_v jtrv
where jtrv.terr_id = ci_terr_id
order by resource_name;
SELECT distinct TERR_QUAL_ID,
TERR_ID,
QUAL_USG_ID,
ORG_ID,
wf_notification.substitutespecialchars(qualifier_name) qualifier_name
FROM jtf_terr_qualifiers_v
WHERE terr_id = p_template_terr_id;
SELECT j1.TERR_VALUE_ID
, wf_notification.substitutespecialchars(j1.COMPARISON_OPERATOR) COMPARISON_OPERATOR
, wf_notification.substitutespecialchars(j1.LOW_VALUE_CHAR_DESC) LOW_VALUE_CHAR_DESC
, wf_notification.substitutespecialchars(j1.HIGH_VALUE_CHAR_DESC) HIGH_VALUE_CHAR_DESC
, j1.LOW_VALUE_NUMBER
, j1.HIGH_VALUE_NUMBER
, wf_notification.substitutespecialchars(j1.INTEREST_TYPE) INTEREST_TYPE
, wf_notification.substitutespecialchars(j1.PRIMARY_INTEREST_CODE) PRIMARY_INTEREST_CODE
, wf_notification.substitutespecialchars(j1.SECONDARY_INTEREST_CODE) SECONDARY_INTEREST_CODE
, wf_notification.substitutespecialchars(j1.CURRENCY_CODE) CURRENCY_CODE
, j1.LOW_VALUE_CHAR_ID
, wf_notification.substitutespecialchars(DISPLAY_TYPE) DISPLAY_TYPE
, wf_notification.substitutespecialchars(CONVERT_TO_ID_FLAG) CONVERT_TO_ID_FLAG
FROM jtf_terr_values_desc_v j1
WHERE j1.terr_qual_id = p_terr_qual_id
ORDER BY j1.value_set;
SELECT FND_GLOBAL.TAB
INTO v_tab
from dual;
v_tabrow := v_tabrow||'Created: '||rec_terr.creation_date||' Updated: '||rec_terr.last_update_date||v_tab;