首页 > 代码库 > Using Post_Query Trigger in Oracle Forms
Using Post_Query Trigger in Oracle Forms
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;
Using Post_Query Trigger in Oracle Forms
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。