The following lines contain the word 'select', 'insert', 'update' or 'delete':
select struct.concatenated_segment_delimiter separator,
vs.flex_value_set_name name,
seg.segment_num num,
seg.application_column_name column_name,
qual.segment_attribute_type qualifier,
seg.form_left_prompt prompt,
rownum pos,
'LOCATION_ID_SEGMENT_'||to_char(seg.segment_num) column_num
from fnd_flex_value_sets vs,
fnd_id_flex_segments_vl seg,
fnd_segment_attribute_values qual,
fnd_id_flex_structures struct
where seg.application_id = appl_id
and seg.id_flex_code = flex_code
and seg.flex_value_set_id = vs.flex_value_set_id
and seg.id_flex_num = structure_id
and qual.id_flex_code(+) = flex_code
and qual.id_flex_num(+) = structure_id
and qual.application_id(+) = appl_id
and qual.application_column_name(+) = seg.application_column_name
and qual.attribute_value(+) = 'Y'
and seg.enabled_flag = 'Y'
and struct.id_flex_code = seg.id_flex_code
and struct.id_flex_num = seg.id_flex_num
order by seg.segment_num, qual.segment_attribute_type;
| Loop over each selected segment, expanding any tokens as requested |
+-------------------------------------------------------------------------*/
while arp_standard.get_next_word( segments, segment )
loop
if str is not null
then
str := str || token_expand( flex_handle, separator, segment );