The following lines contain the word 'select', 'insert', 'update' or 'delete':
select j.terr_id, wf_notification.substitutespecialchars(j.name) name, j.rank
from jtf_terr j
where NVL(j.end_date_active, sysdate) >= sysdate
AND j.start_date_active <= sysdate
AND EXISTS
( select jtr.terr_id
from jtf_terr_rsc jtr, jtf_terr_qual jtq --, jtf_terr_usgs jtu
where jtr.terr_id = jtq.terr_id
and jtr.resource_id = decode(l_srp,-1,jtr.resource_id,l_srp)
and jtq.qual_usg_id = decode(l_qual, -1, jtq.qual_usg_id, l_qual)
--and jtu.source_id = decode(l_usg, -1, jtu.source_id, l_usg)
AND jtr.terr_id = j.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(j1.CNR_GROUP_NAME) CNR_GROUP_NAME
, wf_notification.substitutespecialchars(DISPLAY_TYPE) DISPLAY_TYPE
, wf_notification.substitutespecialchars(CONVERT_TO_ID_FLAG) CONVERT_TO_ID_FLAG
--bug#3175772
, VALUE1_ID
, wf_notification.substitutespecialchars(VALUE1_DESC) VALUE1_DESC
, VALUE2_ID
, wf_notification.substitutespecialchars(VALUE2_DESC) VALUE2_DESC
, VALUE3_ID
, wf_notification.substitutespecialchars(VALUE3_DESC) VALUE3_DESC
FROM jtf_terr_values_desc_v j1
WHERE j1.terr_qual_id = p_terr_qual_id
ORDER BY j1.LOW_VALUE_CHAR_DESC, j1.COMPARISON_OPERATOR;
select terr_id, wf_notification.substitutespecialchars(name) name, rank from jtf_terr_all
where terr_id in
(select jtr.terr_id from jtf_terr_rsc jtr, jtf_terr_qual jtq
where jtr.terr_id = jtq.terr_id
and jtr.resource_id = decode(l_srp,-1,jtr.resource_id,l_srp)
and jtq.qual_usg_id = decode(l_qual, -1, jtq.qual_usg_id, l_qual));
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(j1.CNR_GROUP_NAME) CNR_GROUP_NAME
, 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.LOW_VALUE_CHAR_DESC, j1.COMPARISON_OPERATOR;
SELECT FND_GLOBAL.TAB
INTO v_tab
FROM dual;