When a query is open in the block, the Post-Query trigger fires each time Oracle Forms fetches a record into a block. The trigger fires once for each record placed on the block's list of records.
Definition Level form or block
SELECT statements, unrestricted Built-ins
Enter Query Mode no
Use a Post-Query trigger to perform the following tasks:
Oracle Forms flushes the record from the block and attempts to fetch the next record from the database. If there are no other records in the database, Oracle Forms closes the query and waits for the next operator action.
Fetch Records
This example retrieves descriptions for code fields, for display in non-database items in the current block.
DECLARE
CURSOR lookup_payplan IS SELECT Payplan_Desc
FROM Payplan
WHERE Payplan_Id =
:Employee.Payplan_Id;
CURSOR lookup_area IS SELECT Area_Name
FROM Zip_Code
WHERE Zip = :Employee.Zip;
BEGIN
/*
** Lookup the Payment Plan Description given the
** Payplan_Id in the Employee Record just fetched.
** Use Explicit Cursor for highest efficiency.
*/
OPEN lookup_payplan;
FETCH lookup_payplan INTO :Employee.Payplan_Desc_Nondb;
CLOSE lookup_payplan;
/*
** Lookup Area Descript given the Zipcode in
** the Employee Record just fetched. Use Explicit
** Cursor for highest efficiency.
*/
OPEN lookup_area;
FETCH lookup_area INTO :Employee.Area_Desc_Nondb;
CLOSE lookup_area;
END;