The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT s.segment_num INTO this_segment_num
FROM fnd_id_flex_segments s, fnd_segment_attribute_values sav,
fnd_segment_attribute_types sat
WHERE s.application_id = appl_id
AND s.id_flex_code = key_flex_code
AND s.id_flex_num = structure_number
AND s.enabled_flag = 'Y'
AND s.application_column_name = sav.application_column_name
AND sav.application_id = appl_id
AND sav.id_flex_code = key_flex_code
AND sav.id_flex_num = structure_number
AND sav.attribute_value = 'Y'
AND sav.segment_attribute_type = sat.segment_attribute_type
AND sat.application_id = appl_id
AND sat.id_flex_code = key_flex_code
AND sat.unique_flag = 'Y'
AND sat.segment_attribute_type = flex_qual_name
AND '$Header: AFFFAPIB.pls 120.3 2010/05/25 17:13:54 tebarnes ship $' IS NOT NULL;
SELECT count(segment_num) INTO segment_number
FROM fnd_id_flex_segments
WHERE application_id = appl_id
AND id_flex_code = key_flex_code
AND id_flex_num = structure_number
AND enabled_flag = 'Y'
AND segment_num <= this_segment_num
AND '$Header: AFFFAPIB.pls 120.3 2010/05/25 17:13:54 tebarnes ship $' IS NOT NULL;
SELECT application_column_name
INTO x_app_column_name
FROM fnd_segment_attribute_values
WHERE application_id = x_application_id
AND id_flex_code = x_id_flex_code
AND id_flex_num = x_id_flex_num
AND segment_attribute_type = x_seg_attr_type
AND attribute_value = 'Y'
AND '$Header: AFFFAPIB.pls 120.3 2010/05/25 17:13:54 tebarnes ship $' IS NOT NULL;
SELECT application_column_name, segment_name,
form_left_prompt, flex_value_set_name
INTO x_appcol_name, x_seg_name,
x_prompt, x_value_set_name
FROM fnd_id_flex_segments_vl s, fnd_flex_value_sets vs
WHERE s.application_id = x_application_id
AND s.id_flex_code = x_id_flex_code
AND s.id_flex_num = x_id_flex_num
AND s.segment_num = x_seg_num
AND s.enabled_flag = 'Y'
AND s.flex_value_set_id = vs.flex_value_set_id
AND '$Header: AFFFAPIB.pls 120.3 2010/05/25 17:13:54 tebarnes ship $' IS NOT NULL;
SELECT COUNT(*)
INTO x_num_of_segments
FROM fnd_descr_flex_column_usages
WHERE application_id = x_application_id
AND descriptive_flexfield_name = '$SRS$.'||x_conc_prog_name
AND enabled_flag = 'Y'
AND '$Header: AFFFAPIB.pls 120.3 2010/05/25 17:13:54 tebarnes ship $' IS NOT NULL;
SELECT concatenated_segment_delimiter
INTO delimiter
FROM fnd_id_flex_structures
WHERE application_id = x_application_id
AND id_flex_code = x_id_flex_code
AND id_flex_num = x_id_flex_num
AND '$Header: AFFFAPIB.pls 120.3 2010/05/25 17:13:54 tebarnes ship $' IS NOT NULL;
SELECT 1
INTO row_count
FROM fnd_descr_flex_column_usages u, fnd_descr_flex_contexts c
WHERE u.application_id = x_application_id
AND u.descriptive_flexfield_name = x_desc_flex_name
AND c.application_id = u.application_id
AND c.descriptive_flexfield_name = u.descriptive_flexfield_name
AND c.descriptive_flex_context_code = u.descriptive_flex_context_code
AND c.enabled_flag = 'Y'
AND u.enabled_flag = 'Y'
AND '$Header: AFFFAPIB.pls 120.3 2010/05/25 17:13:54 tebarnes ship $' IS NOT NULL
AND ROWNUM = 1;
SELECT 1
INTO row_count
FROM fnd_descr_flex_column_usages u, fnd_descr_flex_contexts c
WHERE u.application_id = x_application_id
AND u.descriptive_flexfield_name = x_desc_flex_name
AND c.application_id = u.application_id
AND c.descriptive_flexfield_name = u.descriptive_flexfield_name
AND c.descriptive_flex_context_code = u.descriptive_flex_context_code
AND c.enabled_flag = 'Y'
AND u.enabled_flag = 'Y'
AND u.required_flag = 'Y'
AND '$Header: AFFFAPIB.pls 120.3 2010/05/25 17:13:54 tebarnes ship $' IS NOT NULL
AND ROWNUM = 1;
SELECT 1
INTO row_count
FROM fnd_descr_flex_column_usages u, fnd_descr_flex_contexts c
WHERE u.application_id = x_application_id
AND u.descriptive_flexfield_name = x_desc_flex_name
AND c.application_id = u.application_id
AND c.descriptive_flexfield_name = u.descriptive_flexfield_name
AND c.descriptive_flex_context_code = u.descriptive_flex_context_code
AND c.enabled_flag = 'Y'
AND u.enabled_flag = 'Y'
AND u.display_flag = 'Y'
AND '$Header: AFFFAPIB.pls 120.3 2010/05/25 17:13:54 tebarnes ship $' IS NOT NULL
AND ROWNUM = 1;
SELECT end_user_column_name
FROM fnd_descr_flex_column_usages
WHERE application_id = p_application_id
AND descriptive_flexfield_name = p_flexfield_name
AND descriptive_flex_context_code = p_context_code
AND enabled_flag = 'Y'
AND required_flag = 'Y';
SELECT context_required_flag
INTO l_context_required_flag
FROM fnd_descriptive_flexs
WHERE application_id = p_application_id
AND descriptive_flexfield_name = p_flexfield_name;