The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT /*+ leading(x) */ xy.attribute_id Attribute_ID,
xy.rule_id Rule_ID,
rule.currency_code Currency_Code,
criterion.operator Operator,
criterion.selection_criteria_id Criteria_ID,
AttVal.attribute_value Attr_Value,
AttVal.attribute_to_value Attr_To_Value
FROM pv_process_rules_vl Rule,
pv_enty_select_criteria Criterion,
pv_selected_attr_values AttVal,
( SELECT attribute_id,TO_NUMBER(LTRIM(substr(rule_rank, 1, 10), 0)) rank,TO_NUMBER(LTRIM(substr(rule_rank, 11, LENGTH(rule_rank)), 0)) rule_id
FROM (
SELECT z.attribute_id, MAX(LPAD(z.rank, 10, 0) || LPAD(z.process_rule_id, 100, 0)) rule_rank
FROM (
SELECT a.process_rule_id, b.attribute_id, x.rank, x.process_rule_id rule_id
FROM pv_process_rules_vl a,
pv_enty_select_criteria b,
(SELECT rownum rank, column_value process_rule_id
FROM (SELECT column_value
FROM TABLE (CAST(p_rule_id_tbl AS JTF_NUMBER_TABLE))) ) x
WHERE a.process_rule_id = x.process_rule_id
AND a.process_rule_id = b.process_rule_id ) z
group by z.attribute_id
)) xy
WHERE Rule.process_rule_id = Criterion.process_rule_id
AND Criterion.selection_criteria_id = Attval.selection_criteria_id
AND Criterion.selection_type_code = 'PARTNER_SELECTION'
AND Rule.process_rule_id = xy.rule_id
AND criterion.attribute_id = xy.attribute_id
AND criterion.process_rule_id = xy.rule_id
order by xy.rank;
SELECT lov_string
FROM pv_entity_attrs
WHERE lov_string IS NOT NULL
AND entity = 'PARTNER'
AND enabled_flag = 'Y'
AND attribute_id = pc_attribute_id;
-- Here the values will be inserted to the PL/SQL table only for the last record
-- and also if it is an OR condition
-- ========================================================================================
IF l_criteria_count >= 1 THEN
l_cnt := l_cnt + 1;
-- Making sure that first record does not get inserted always with criteria
-- condition check.For the first record all the previous values will be null.
-- ============================================================================
l_cnt := l_cnt + 1;
-- Here the values will be inserted to the PL/SQL table only for the last record
-- and also if it is an AND condition
-- ========================================================================================
IF (lc_get_rule_details%NOTFOUND
AND l_total_rows > 0 AND l_criteria_count = 0) THEN
l_last_cri_cnt := l_criteria_count ;
select meaning
into l_opr_meaning
from pv_lookups
where lookup_type = 'PV_NUM_DATE_OPERATOR'
and lookup_code = l_operator_tbl(i);
l_lov_string := 'SELECT decode(t.code, :1, t.meaning, t.code) Attr_Value ,'||
'decode(t.code, :2, t.meaning, t.code) Attr_to_Value, t.code ' ||
'FROM ('|| l_lov_string ||' ) t WHERE t.code in ( :4,:5)';
l_lov_string := 'SELECT t.meaning FROM (' || l_lov_string ||' ) t WHERE t.code IN '||
'( SELECT * FROM THE ( SELECT CAST( :Y as JTF_VARCHAR2_TABLE_32767 ) from dual ))';
SELECT xy.attribute_id Attribute_ID,
xy.rule_id Rule_ID,
rule.currency_code Currency_Code,
criterion.operator Operator,
criterion.selection_criteria_id Criteria_ID,
AttVal.attribute_value Attr_Value,
AttVal.attribute_to_value Attr_To_Value
FROM pv_process_rules_vl Rule,
pv_enty_select_criteria Criterion,
pv_selected_attr_values AttVal,
( SELECT attribute_id,TO_NUMBER(LTRIM(substr(rule_rank, 1, 10), 0)) rank,TO_NUMBER(LTRIM(substr(rule_rank, 11, LENGTH(rule_rank)), 0)) rule_id
FROM (
SELECT z.attribute_id, MAX(LPAD(z.rank, 10, 0) || LPAD(z.process_rule_id, 100, 0)) rule_rank
FROM (
SELECT a.process_rule_id, b.attribute_id, x.rank, x.process_rule_id rule_id
FROM pv_process_rules_vl a,
pv_enty_select_criteria b,
(SELECT rownum rank, column_value process_rule_id
FROM (SELECT column_value
FROM TABLE (CAST(p_rule_id_tbl AS JTF_NUMBER_TABLE))) ) x
WHERE a.process_rule_id = x.process_rule_id
AND a.process_rule_id = b.process_rule_id ) z
group by z.attribute_id
)) xy
WHERE Rule.process_rule_id = Criterion.process_rule_id
AND Criterion.selection_criteria_id = Attval.selection_criteria_id
AND Criterion.selection_type_code = 'PARTNER_SELECTION'
AND Rule.process_rule_id = xy.rule_id
AND criterion.attribute_id = xy.attribute_id
AND criterion.process_rule_id = xy.rule_id
order by xy.rank;
SELECT lov_string
FROM pv_entity_attrs
WHERE lov_string IS NOT NULL
AND entity = 'PARTNER'
AND enabled_flag = 'Y'
AND attribute_id = pc_attribute_id;
select meaning
into l_opr_meaning
from pv_lookups
where lookup_type = 'PV_NUM_DATE_OPERATOR'
and lookup_code = l_operator_tbl(i);
l_lov_string := 'SELECT decode(t.code, :1, t.meaning, t.code) Attr_Value ,'||
'decode(t.code, :2, t.meaning, t.code) Attr_to_Value, t.code ' ||
'FROM ('|| l_lov_string ||' ) t WHERE t.code in ( :4,:5)';
l_lov_string := 'SELECT t.meaning FROM (' || l_lov_string ||' ) t WHERE t.code IN '||
'( SELECT * FROM THE ( SELECT CAST( :Y as JTF_VARCHAR2_TABLE_32767 ) from dual ))';