Using Post_Query Trigger in Oracle Forms
2016-12-25 20:00
671 查看
When a query is open in the block, the Post-Query trigger fires each time Form Builder fetches a record into a block. The trigger fires once for each record placed on the block’s list of records.
Usage Notes
Use a Post-Query trigger to perform the following tasks:
· populate control items or items in other blocks
· calculate statistics about the records retrieved by a query
· calculate a running total
· When you use a Post-Query trigger to SELECT non-base table values into control items, Form Builder marks each record as CHANGED, and so fires the When-Validate-Item trigger by default. You can avoid the execution of the When-Validate-Item trigger by explicitly setting the Status property of each record to QUERY in the Post-Query trigger. To set record status programmatically, use SET_RECORD_PROPERTY.
See also:
http://www.foxinfotech.in/2013/02/populating-display-item-value-on-query.html
http://www.foxinfotech.in/2014/02/pre-query-post-query-displayitem-oracle-forms.html
Example
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;
Usage Notes
Use a Post-Query trigger to perform the following tasks:
· populate control items or items in other blocks
· calculate statistics about the records retrieved by a query
· calculate a running total
· When you use a Post-Query trigger to SELECT non-base table values into control items, Form Builder marks each record as CHANGED, and so fires the When-Validate-Item trigger by default. You can avoid the execution of the When-Validate-Item trigger by explicitly setting the Status property of each record to QUERY in the Post-Query trigger. To set record status programmatically, use SET_RECORD_PROPERTY.
See also:
http://www.foxinfotech.in/2013/02/populating-display-item-value-on-query.html
http://www.foxinfotech.in/2014/02/pre-query-post-query-displayitem-oracle-forms.html
Example
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;
相关文章推荐
- Define Custom Data Filter Using Pre-Query Trigger In Oracle Forms
- Using Post-Form Trigger In Oracle Forms
- An Example of Pre-Query and Post-Query Triggers in Oracle Forms With Using Display_Item to Highlight Dynamically
- Enter Query Mode Search Tricks Using Enter_Query Built-in in Oracle Forms
- Learn How To Create Trigger In Oracle Forms
- An Example of On-Error Trigger in Oracle Forms
- Using Single Alert For Messages And Confirmation Messages In Oracle Forms With Set_Alert_Button_Property
- oracle fuzzy inquery, using ignore case.
- Examples For When-Validate-Item trigger In Oracle Forms
- An Example Of Validating Text Item In Oracle Forms Using When-Validate-Item Trigger
- Quick Trick About Using Dbms_Metadata With Forms_DDL In Oracle Forms
- Populate A List Item With Record Group In Oracle Forms Using Populate_List And Create_Group_From_Query Command
- Perform Cut Copy Paste Operations Using Cut_Region Copy_Region Paste_Region Commands In Oracle Forms
- Displaying Tabbed and Stacked Canvas Using Show_View In Oracle Forms
- Using GET_GROUP_SELECTION For Record Groups in Oracle Forms
- Trigger Execution Sequence in Oracle Forms
- Create Data Block Based On From Clause Query In Oracle Forms
- Freebie - Utility Form: Generate Excel Report From SQL Query In Oracle Forms 6i And 11g
- Pre-Query trigger in Oracle D2k / Oracle Forms
- Change An Item Property Using Set_Item_Property In Oracle Forms