In Oracle Forms, LOVs (List of Values) are a very useful feature that allows developers to provide users with a predefined list of valid values for a field. Instead of manually entering values, users can pick one from the LOV, ensuring accuracy and consistency. LOVs not only improve data entry speed but also reduce the chances of errors.
This article explains in detail how to create LOVs in Oracle Forms, how to attach them to text items, and how to customize their behavior with examples.
What is an LOV in Oracle Forms?
An LOV (List of Values) is a pop-up window that displays a set of records from which a user can choose a value. It is similar to a dropdown list but much more powerful, as it can be based on queries, multiple columns, and conditions.
LOVs are often attached to text items to allow users to select valid values from another table or set of data.
Steps to Create LOVs in Oracle Forms
Follow these steps to create a List of Values in Oracle Forms:
1. Open the Object Navigator
- In Oracle Forms Builder, open your form module.
- Navigate to the LOVs node in the Object Navigator.
2. Create a New LOV
- Right-click on the LOVs node and select Create.
- A new LOV will be created with a default name (e.g., LOV1).
3. Define the LOV Properties
- Open the Property Palette of the LOV.
- Set the following properties:
- Title: Enter a user-friendly title for the LOV window.
- Column Mapping: Define which columns will be displayed.
- Return Values: Specify which column’s value will be returned to the form field.
4. Define the LOV Query
You can define a SQL query to fetch values for the LOV. For example:
SELECT DEPTNO, DNAME FROM DEPT ORDER BY DNAME;
This query will display department numbers and names from the DEPT table.
5. Attach the LOV to a Text Item
- Navigate to the Text Item (e.g., DEPTNO field) where the LOV should be used.
- In the Property Palette, set:
- List of Values → Select the LOV you just created.
- Validate from List → Set to Yes if you want to restrict users to only LOV values.
6. Run the Form
- Press Ctrl+R or click Run Form.
- When you navigate to the DEPTNO field, press Ctrl+L (default key for LOV).
- The LOV window will appear, allowing you to choose a department.
Example: Creating a Department LOV
Suppose you want users to select a department number for an employee.
- Create a LOV with the query:
SELECT DEPTNO, DNAME FROM DEPT; - Display both DEPTNO and DNAME in the LOV.
- Set Return Item →
DEPTNOto return the selected department number. - Attach the LOV to the EMP.DEPTNO text item.
Now, when users are entering an employee record, they can choose the department number from the LOV instead of typing it manually.
Customizing LOV Behavior
Oracle Forms LOVs can be customized to make them more user-friendly:
- Automatic Display: Use the
SHOW_LOVbuilt-in in a trigger (likeWHEN-NEW-ITEM-INSTANCE) to display the LOV automatically when entering the field.BEGIN SHOW_LOV('DEPT_LOV'); END; - Restrict Values: Set Validate from List = Yes to ensure only LOV values are allowed.
- Dynamic LOVs: LOVs can be based on record groups created at runtime using the
CREATE_GROUP_FROM_QUERYandPOPULATE_GROUPbuilt-ins.
Best Practices for LOVs in Oracle Forms
- Keep LOVs small and focused
Avoid writing queries that fetch thousands of rows; use conditions to limit results. - Display user-friendly values
Show meaningful descriptions (like department name) along with IDs. - Use Validate from List carefully
If enabled, users cannot type free values. Use it only when required. - Consider Record Groups for flexibility
For dynamic LOVs, record groups provide better control and reusability.
Conclusion
Creating LOVs in Oracle Forms is an essential skill for developers to enhance user experience and ensure data accuracy. By defining an LOV, attaching it to text items, and customizing its behavior, you can make data entry faster, more reliable, and user-friendly. Whether static or dynamic, LOVs remain one of the most important features in Oracle Forms applications.

