Professional Documents
Culture Documents
Oracle Forms
A Forms dynamic LOV
Home page
The purpose is to manage dynamic LOVs, able to build any LOV of 1 to 9 columns.
The record group is dynamically populated by the SELECT order provided, then the LOV is tuned to fit and display
the corresponding columns.
The data selected from the LOV are copied into 9 hidden items stored in a control block (:LOV).
The copy process is done in an Item-level KEY-LISTVAL trigger:
Declare
LB$Ok Boolean ;
LC$Lov Varchar2(30) := Get_Item_Property(:system.trigger_item, LOV_NAME) ;
https://sheikyerbouti.developpez.com/forms/dynamic_lov/dynamic_lov.htm 1/3
4/19/2018 A Dynamic LOV
Begin
If LC$Lov Is not null Then
LB$Ok := Show_Lov(LC$Lov);
If LB$Ok Then
-- get returned values --
:BL.TXT1 := :LOV.RETURN1 ;
End if ;
End if ;
End;
The LOV populating process is done in the POPULATE_LOV() procedure, stored in the program unit of the
sample dialog provided,
But you can, of course, copy it in a PL/SQL library.
(In fact you need to keep together: PKG_COLLECT package, Build_Select_line function and Populate_LOV
procedure)
To populate the LOV, and eventually attach it to an item, use the Populate_LOV() procedure
PROCEDURE Populate_LOV
(
PC$SQL_Order IN VARCHAR2,
PC$NumLOV IN VARCHAR2,
PC$Title IN VARCHAR2,
PC$TargetItem IN VARCHAR2 default null,
PB$Display IN BOOLEAN Default false
)
e.g.:
Populate_LOV
(
'Select empno, ename, sal from emp',
'1',
'Choose an employee',
'BL.TXT1',
False
);
Special case:
If you need to incorporate a function that contains a comma, To_Char(), for instance, replace the comma by a ;
e.g.
select empno, ename, sal, TO_CHAR(hiredate;'DD/MM/YYYY') "HIREDATE" from emp
https://sheikyerbouti.developpez.com/forms/dynamic_lov/dynamic_lov.htm 2/3
4/19/2018 A Dynamic LOV
· Download the dynamic_lov.fmb sample dialog for you to test (Forms 9.0.2)
To implement it into you own Forms, you can simply drag the DYN_LOV object group into your module.
https://sheikyerbouti.developpez.com/forms/dynamic_lov/dynamic_lov.htm 3/3