The following lines contain the word 'select', 'insert', 'update' or 'delete':
select s.segment_num, s.application_column_name, s.flex_value_set_id
from fnd_id_flex_segments s
where s.application_id = p_application_id
and s.id_flex_code = p_id_flex_code
and s.id_flex_num = p_id_flex_num
and s.enabled_flag = 'Y'
and p_qualifier = 'ALL'
and p_segnum is null
union all
select s.segment_num, s.application_column_name, s.flex_value_set_id
from fnd_id_flex_segments s,
fnd_segment_attribute_values sav,
fnd_segment_attribute_types sat
where s.application_id = p_application_id
and s.id_flex_code = p_id_flex_code
and s.id_flex_num = p_id_flex_num
and s.enabled_flag = 'Y'
and s.application_column_name = sav.application_column_name
and sav.application_id = p_application_id
and sav.id_flex_code = p_id_flex_code
and sav.id_flex_num = p_id_flex_num
and sav.attribute_value = 'Y'
and sav.segment_attribute_type = sat.segment_attribute_type
and sat.application_id = p_application_id
and sat.id_flex_code = p_id_flex_code
and sat.unique_flag = 'Y'
and sat.segment_attribute_type = p_qualifier
and p_qualifier <> 'ALL'
and p_segnum is null
union all
select s.segment_num, s.application_column_name, s.flex_value_set_id
from fnd_id_flex_segments s
where s.application_id = p_application_id
and s.id_flex_code = p_id_flex_code
and s.id_flex_num = p_id_flex_num
and s.enabled_flag = 'Y'
and s.segment_num = p_segnum
and p_qualifier is null
order by 1;
select c.segment_num parent_seg_num
from FND_FLEX_VALUE_SETS a, FND_ID_FLEX_SEGMENTS b, FND_ID_FLEX_SEGMENTS c
where b.APPLICATION_ID = p_application_id
and b.ID_FLEX_CODE = p_id_flex_code
and b.ID_FLEX_NUM = p_id_flex_num
and (b.FLEX_VALUE_SET_ID = a.FLEX_VALUE_SET_ID)
and b.APPLICATION_ID = c.APPLICATION_ID
and b.ID_FLEX_CODE = c.ID_FLEX_CODE
and b.ID_FLEX_NUM = c.ID_FLEX_NUM
and (a.PARENT_FLEX_VALUE_SET_ID = c.FLEX_VALUE_SET_ID)
and a.FLEX_VALUE_SET_ID = p_value_set_id;
select id_flex_num into l_id_flex_num
from fnd_id_flex_structures
where application_id = p_application_id
and id_flex_code = p_id_flex_code;
select concatenated_segment_delimiter into sep
from fnd_id_flex_structures
where application_id = p_application_id
and id_flex_code = p_id_flex_code
and id_flex_num = p_id_flex_num;
if p_mode not in ('SELECT', 'WHERE', 'HAVING', 'ORDER BY', 'GROUP BY') or
p_function not in ('=', '<', '>', '<=', '>=', '!=', 'BETWEEN') then
raise invalid_argument;
if p_mode in ('SELECT', 'GROUP BY') then
if buffer is not null then buffer := buffer || '||''' ||sep|| '''||';
select application_table_name , unique_id_column_name
into l_table_name, l_unique_id_column_name
from fnd_id_flexs
where application_id = p_application_id
and id_flex_code = p_id_flex_code;
sqlstmt := 'SELECT '||sqlstmt||' FROM '||l_table_name||' WHERE '||l_unique_id_column_name||' = :ccid';
fa_rx_util_pkg.debug('get_value: ' || 'Executing SELECT...');