The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT ind.flex_value_set_name parent_value_set_name
FROM fnd_flex_value_sets ind
,fnd_flex_value_sets dep
WHERE ind.flex_value_set_id = dep.parent_flex_value_set_id
AND dep.flex_value_set_id = p_flex_value_set_id;
SELECT DECODE(fvt.value_column_type
,'D','fnd_date.date_to_displaydate('||fvt.value_column_name||')'
,'N',fvt.value_column_name
,fvt.value_column_name
) AS value_column_name
,NVL(fvt.meaning_column_name,'NULL') AS meaning_column_name
,DECODE(NVL(fvt.id_column_type,fvt.value_column_type)
,'D','fnd_date.date_to_canonical('||NVL(fvt.id_column_name,fvt.value_column_name)||')'
,'N','fnd_number.number_to_canonical('||NVL(fvt.id_column_name,fvt.value_column_name)||')'
,NVL(fvt.id_column_name,fvt.value_column_name)
) AS id_column_name
,NVL(fvt.id_column_type,fvt.value_column_type) AS id_column_type
,'AND '||NVL(fvt.id_column_name,fvt.value_column_name)||' = :$FLEX$.$$'||p_flex_value_set_name AS identification_clause
,fvt.application_table_name AS from_clause
,fvt.additional_where_clause AS where_and_order_clause
,fvt.additional_where_clause AS where_clause
,fvt.additional_where_clause AS order_clause
,fvt.start_date_column_name
,fvt.end_date_column_name
,fvt.additional_quickpick_columns
FROM fnd_flex_validation_tables fvt
WHERE fvt.flex_value_set_id = p_flex_value_set_id;
p_validation_sql := 'SELECT '||l_validation_table.value_column_name
||' ,'||l_validation_table.meaning_column_name
||' ,'||l_validation_table.id_column_name||' AS id'
||' ,'||NVL(l_additional_column1,'NULL')
||' ,'||NVL(l_additional_column2,'NULL')
||' ,'||NVL(l_additional_column3,'NULL')
||' FROM '||l_validation_table.from_clause
||' '||l_validation_table.where_clause
||' '||l_validation_table.order_clause;
p_identification_sql := 'SELECT '||l_validation_table.value_column_name
||' ,'||l_validation_table.meaning_column_name
||' ,'||l_validation_table.id_column_name
||' ,NULL'
||' ,NULL'
||' ,NULL'
||' FROM '||l_validation_table.from_clause
||' '||l_validation_table.where_clause
||' '||l_validation_table.identification_clause;
p_validation_sql := 'SELECT ffv.flex_value_meaning'
||' ,ffv.description'
||' ,ffv.flex_value'
||' ,NULL'
||' ,NULL'
||' ,NULL'
||' FROM fnd_flex_values_vl ffv'
||' WHERE ffv.flex_value_set_id = fnd_number.canonical_to_number('||fnd_number.number_to_canonical(p_flex_value_set_id)||')'
||' AND '||l_effective_date||' BETWEEN NVL(ffv.start_date_active,'||l_effective_date||')'
||' AND NVL(ffv.end_date_active,'||l_effective_date||')'
||' AND ffv.enabled_flag = ''Y'''
||' ORDER BY ffv.flex_value';
p_identification_sql := 'SELECT ffv.flex_value_meaning'
||' ,ffv.description'
||' ,ffv.flex_value'
||' ,NULL'
||' ,NULL'
||' ,NULL'
||' FROM fnd_flex_values_vl ffv'
||' WHERE ffv.flex_value_set_id = fnd_number.canonical_to_number('||fnd_number.number_to_canonical(p_flex_value_set_id)||')'
-- ||' AND '||l_effective_date||' BETWEEN NVL(ffv.start_date_active,'||l_effective_date||')'
-- ||' AND NVL(ffv.end_date_active,'||l_effective_date||')'
-- ||' AND ffv.enabled_flag = ''Y'''
||' AND ffv.flex_value = :$FLEX$.'||p_flex_value_set_name;
p_validation_sql := 'SELECT ffv.flex_value_meaning'
||' ,ffv.description'
||' ,ffv.flex_value'
||' ,NULL'
||' ,NULL'
||' ,NULL'
||' FROM fnd_flex_values_vl ffv'
||' WHERE ffv.flex_value_set_id = fnd_number.canonical_to_number('||fnd_number.number_to_canonical(p_flex_value_set_id)||')'
||' AND '||l_effective_date||' BETWEEN NVL(ffv.start_date_active,'||l_effective_date||')'
||' AND NVL(ffv.end_date_active,'||l_effective_date||')'
||' AND ffv.enabled_flag = ''Y'''
||' AND ffv.parent_flex_value_low = '||l_parent_value_set_name
||' ORDER BY ffv.flex_value';
p_identification_sql := 'SELECT ffv.flex_value_meaning'
||' ,ffv.description'
||' ,ffv.flex_value'
||' ,NULL'
||' ,NULL'
||' ,NULL'
||' FROM fnd_flex_values_vl ffv'
||' WHERE ffv.flex_value_set_id = fnd_number.canonical_to_number('||fnd_number.number_to_canonical(p_flex_value_set_id)||')'
||' AND '||l_effective_date||' BETWEEN NVL(ffv.start_date_active,'||l_effective_date||')'
||' AND NVL(ffv.end_date_active,'||l_effective_date||')'
||' AND ffv.enabled_flag = ''Y'''
||' AND ffv.parent_flex_value_low = '||l_parent_value_set_name
||' AND ffv.flex_value = :$FLEX$.'||p_flex_value_set_name;
SELECT fvs.flex_value_set_id
,fvs.alphanumeric_allowed_flag
,fvs.flex_value_set_name
,fvs.format_type
,fvs.longlist_flag
,fvs.maximum_size
,fvs.maximum_value
,fvs.minimum_value
,fvs.number_precision
,fvs.numeric_mode_enabled_flag
,fvs.uppercase_only_flag
,fvs.validation_type
FROM fnd_flex_value_sets fvs
WHERE fvs.flex_value_set_id = p_flex_value_set_id;