Oracle EBS Value Set Query, Lookup Query and DFF Query Generator
This generator writes five queries against the Oracle EBS FND flexfield and lookup tables: value set definition, value set values, a rebuilt LOV query for table-validated sets, active lookup codes and descriptive flexfield segments with their ATTRIBUTE columns. It works on 12.1 and 12.2.
Fill in
DESCRIPTIVE_FLEXFIELD_NAME or the user title.
1. Value set header and type
SELECT s.flex_value_set_id,
s.flex_value_set_name,
DECODE(s.validation_type,
'I', 'Independent', 'D', 'Dependent', 'F', 'Table',
'N', 'None', 'P', 'Pair', 'U', 'Special',
'X', 'Translatable independent', 'Y', 'Translatable dependent',
s.validation_type) AS validation_type,
s.format_type,
s.maximum_size,
s.description
FROM fnd_flex_value_sets s
WHERE s.flex_value_set_name = 'XX_COMPANY_VS';2. Values of an independent or dependent value set
SELECT v.flex_value,
v.description,
v.enabled_flag,
v.parent_flex_value_low,
v.start_date_active,
v.end_date_active,
v.summary_flag
FROM fnd_flex_values_vl v
JOIN fnd_flex_value_sets s ON s.flex_value_set_id = v.flex_value_set_id
WHERE s.flex_value_set_name = 'XX_COMPANY_VS'
ORDER BY v.parent_flex_value_low, v.flex_value;3. Rebuild the LOV query of a table-validated value set
-- ADDITIONAL_WHERE_CLAUSE is selected on its own: it is a LONG column and cannot be concatenated
SELECT 'SELECT ' || t.value_column_name
|| NVL2(t.meaning_column_name, ', ' || t.meaning_column_name, '')
|| NVL2(t.id_column_name, ', ' || t.id_column_name, '')
|| ' FROM ' || t.application_table_name AS lov_select,
t.additional_where_clause
FROM fnd_flex_validation_tables t
JOIN fnd_flex_value_sets s ON s.flex_value_set_id = t.flex_value_set_id
WHERE s.flex_value_set_name = 'XX_COMPANY_VS';4. Active lookup values
SELECT lv.lookup_code,
lv.meaning,
lv.description,
lv.tag,
lv.view_application_id,
lv.security_group_id
FROM fnd_lookup_values lv
WHERE lv.lookup_type = 'YES_NO'
AND lv.language = 'US'
AND lv.enabled_flag = 'Y'
AND TRUNC(SYSDATE) BETWEEN NVL(lv.start_date_active, TRUNC(SYSDATE))
AND NVL(lv.end_date_active, TRUNC(SYSDATE))
ORDER BY lv.lookup_code;5. DFF contexts and segments mapped to ATTRIBUTE columns
SELECT df.descriptive_flexfield_name,
df.title,
df.application_table_name,
u.descriptive_flex_context_code,
u.column_seq_num,
u.application_column_name,
u.end_user_column_name,
u.form_left_prompt,
u.enabled_flag,
u.required_flag,
s.flex_value_set_name
FROM fnd_descriptive_flexs_vl df
JOIN fnd_application fa
ON fa.application_id = df.application_id
JOIN fnd_descr_flex_col_usage_vl u
ON u.application_id = df.application_id
AND u.descriptive_flexfield_name = df.descriptive_flexfield_name
LEFT JOIN fnd_flex_value_sets s
ON s.flex_value_set_id = u.flex_value_set_id
WHERE fa.application_short_name = 'SQLAP'
AND (df.descriptive_flexfield_name = 'AP_INVOICES' OR df.title = 'AP_INVOICES')
ORDER BY u.descriptive_flex_context_code, u.column_seq_num;Uses the standard FND flexfield and lookup tables and views. Verify column names on your release, and note that lookups can be shared across view applications and security groups, so filter on VIEW_APPLICATION_ID when the same lookup type exists twice.
Map your custom DFFs and value sets
Send us the flexfields your reports use and we will return a mapping of segments to columns and LOV queries.
Optional. The tool and every export work without this. No spam.
How to use it
Enter the value set name, a lookup type, the DFF name or title and its application short name. Block 1 tells you the validation type, which decides the next step: Independent and Dependent sets store values in FND_FLEX_VALUES, so use block 2; Table sets store a query definition, so use block 3 to reconstruct the SELECT a form or concurrent program LOV runs. Block 4 returns the codes behind a lookup-driven list, and block 5 tells you which ATTRIBUTEn column on the base table holds each DFF segment, which is what you need for reports and interfaces.
- Find the value set of a concurrent program parameter in block 5 using DFF name $SRS$.<program short name> and the program's application short name.
- Translatable sets (X and Y) also keep their values in FND_FLEX_VALUES_VL.
Where these objects live
Value sets are defined under Application Developer > Validation > Set, with values maintained under Validation > Values. The header is FND_FLEX_VALUE_SETS; values are in FND_FLEX_VALUES with translations in FND_FLEX_VALUES_TL, joined in FND_FLEX_VALUES_VL. Table validation details sit in FND_FLEX_VALIDATION_TABLES: table name, value, meaning and ID columns and the WHERE/ORDER BY clause. Lookups are maintained under Application Developer > Application > Lookups and stored in FND_LOOKUP_VALUES per language and security group. DFF registration is in FND_DESCRIPTIVE_FLEXS, contexts in FND_DESCR_FLEX_CONTEXTS and segments in FND_DESCR_FLEX_COLUMN_USAGES, with the _VL views adding translated prompts.
Reading table-validated LOVs
The additional WHERE clause often contains references that only resolve at runtime. :$FLEX$.<value set name> refers to the value chosen in an earlier segment or parameter that uses that value set, and :$PROFILES$.<profile option name> substitutes a profile value such as ORG_ID. To run the rebuilt query in SQL Developer, replace these with literal values or bind variables. If the LOV on a form field is not driven by a value set, it comes from a record group in the form itself; in that case trace the session (Help > Diagnostics > Trace) and read the SQL from the trace file.
Gotchas
FND_LOOKUP_VALUES has one row per language, so always filter LANGUAGE or you get duplicates on a multilingual instance. The same lookup type can exist under different view applications, which is why block 4 returns VIEW_APPLICATION_ID and SECURITY_GROUP_ID. Disabled DFF segments still appear in the column usage view with ENABLED_FLAG N, and Global Data Elements segments use the context code Global Data Elements. A dependent value set's values repeat per parent, so read PARENT_FLEX_VALUE_LOW together with FLEX_VALUE.
Frequently Asked Questions
How do I find the values of a value set in Oracle Apps R12?
Join FND_FLEX_VALUES_VL to FND_FLEX_VALUE_SETS on FLEX_VALUE_SET_ID and filter FLEX_VALUE_SET_NAME. This works for independent, dependent and translatable sets. Table-validated sets do not store values; read FND_FLEX_VALIDATION_TABLES to get the table and columns and run that query instead.
How do I find the LOV query behind a parameter in Oracle Apps?
Find the parameter's value set (Concurrent > Program > Parameters, or the $SRS$ DFF in block 5), then rebuild the query from FND_FLEX_VALIDATION_TABLES with block 3, and resolve any :$FLEX$ or :$PROFILES$ references. For form fields with hard-coded record groups, use a session trace to capture the SQL.
Which table stores lookups in Oracle EBS?
FND_LOOKUP_VALUES holds the codes, meanings and dates per language, and FND_LOOKUP_TYPES the types. Views such as FND_LOOKUP_VALUES_VL and product views such as FND_LOOKUPS or AR_LOOKUPS add filtering. Some products keep their own lookups in tables like PO_LOOKUP_CODES.
How do I find which ATTRIBUTE column holds a DFF segment?
Query FND_DESCR_FLEX_COL_USAGE_VL by DESCRIPTIVE_FLEXFIELD_NAME and context code. APPLICATION_COLUMN_NAME is the base table column, such as ATTRIBUTE3, and END_USER_COLUMN_NAME and FORM_LEFT_PROMPT are the segment name and prompt users see. The context value itself is stored in the table's ATTRIBUTE_CATEGORY or equivalent context column.
If your users want to ask what a DFF field or lookup code means in plain English, answered from your EBS setup on your own servers, we can set that up.
Related Tools
Oracle EBS XML Publisher Data Template Generator
Fill in your query, parameters and elements and get a valid XML Publisher data template, its PL/SQL default package and the registration steps for R12.
OracleOracle EBS Profile Options Reference
A searchable lookup of the profile options EBS administrators change most: sign-on security, concurrent processing, multi-org, logging and session settings.
Developer ToolsOracle EBS TCA Customer Creation API Script Generator (HZ V2 APIs)
Generate one PL/SQL block that creates an organization customer with account, address and bill-to and ship-to site uses through the public TCA V2 APIs.
OracleOracle EBS Order-to-Cash (O2C) SQL Generator: Order to Delivery to Invoice to Receipt
Build a query that follows each Order Management line through Shipping, Receivables invoicing and cash application in Oracle EBS R12.
More Developer Tools tools
See all- Oracle EBS Onhand Quantity SQL Generator
- Oracle EBS BOM Explosion SQL Generator
- Oracle EBS Pending Transactions SQL Generator for Period Close
- Oracle EBS Public PL/SQL API Reference (OM, INV, PO, AP, AR, TCA, FND)
- Oracle EBS Forms Personalization Tables and Trigger Events Reference
- Oracle EBS Forms FRM Error Codes Reference (FRM-92101, FRM-40735)
- Oracle EBS XML Publisher RTF Template Syntax Reference
- Oracle EBS OE_ORDER_PUB.PROCESS_ORDER Script Generator
- Oracle EBS FND_REQUEST.SUBMIT_REQUEST Code Generator
Keep exploring
Free tools
- Oracle EBS Lookups, Value Sets and Flexfield Tables ReferenceEvery FND table and view you need to decode lookup codes, value set values, table-validated value sets, key flexfield segments and DFF ATTRIBUTE columns in EBS 12.1 and 12.2.
- Oracle EBS Item Attribute Template WorksheetPlan item master attribute values for a new item template, with the underlying MTL_SYSTEM_ITEMS_B column for each attribute.
- Oracle EBS Inventory Tables ReferenceSearchable lookup of the core Oracle EBS Inventory and Cost Management tables with purpose and key columns, for report writers and technical consultants.
ERP fixes and how-tos
- SQL to Find Responsibilities Assigned to a User in Oracle EBSReady-to-run SQL against FND_USER, FND_USER_RESP_GROUPS and FND_RESPONSIBILITY_TL to list every responsibility assigned to an Oracle EBS user.
- SQL query to find profile option values by level in Oracle EBSSQL to list Oracle EBS profile option values at site, application, responsibility and user level using FND_PROFILE_OPTIONS and FND_PROFILE_OPTION_VALUES, with level IDs.
- How to Register a Custom Concurrent Program in Oracle EBSRegister a custom Oracle EBS concurrent program end to end: build the executable, define the program and parameters, and add it to a request group so users can run it.
AI on your ERP
- AI for Oracle E-Business Suite, Without Leaving On-PremHosting Oracle EBS 12.2 on-prem or in a private cloud? Add a private LLM over concurrent programs, interface tables and AP/PO data without moving to Fusion.
- AI for Oracle EBS in Industrial Manufacturing: WIP, MRP, and BOM Questions Answered DirectlyAI for Oracle E-Business Suite in industrial manufacturing: WIP jobs, BOMs, MRP, inventory and purchasing answered in plain English, private and read-only.
Integrations
- How to use ChatGPT with Oracle E-Business SuiteUsing ChatGPT with Oracle E-Business Suite: export vs live access, custom GPT actions over ISG REST, enterprise data controls and when to keep data on-prem.
- How to connect Claude to Oracle E-Business SuiteConnect Claude to Oracle E-Business Suite via MCP, the Anthropic API, AWS Bedrock or Vertex, and know when an on-prem open-weight model is the better fit.