11.01.2013 Views

Oracle Forms Developer – Form Builder Reference, Volume 1

Oracle Forms Developer – Form Builder Reference, Volume 1

Oracle Forms Developer – Form Builder Reference, Volume 1

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Post-Query trigger<br />

Description<br />

When a query is open in the block, the Post-Query trigger fires each time <strong>Form</strong> <strong>Builder</strong> fetches a record<br />

into a block. The trigger fires once for each record placed on the block’s list of records.<br />

Definition Level form or block<br />

Legal Commands<br />

SELECT statements, unrestricted built-ins<br />

Enter Query Mode no<br />

Usage Notes<br />

Use a Post-Query trigger to perform the following tasks:<br />

• populate control items or items in other blocks<br />

• calculate statistics about the records retrieved by a query<br />

• calculate a running total<br />

• When you use a Post-Query trigger to SELECT non-base table values into control items, <strong>Form</strong><br />

<strong>Builder</strong> marks each record as CHANGED, and so fires the When-Validate-Item trigger by default.<br />

You can avoid the execution of the When-Validate-Item trigger by explicitly setting the Status<br />

property of each record to QUERY in the Post-Query trigger. To set record status<br />

programmatically, use SET_RECORD_PROPERTY .<br />

On Failure<br />

<strong>Form</strong> <strong>Builder</strong> flushes the record from the block and attempts to fetch the next record from the database.<br />

If there are no other records in the database, <strong>Form</strong> <strong>Builder</strong> closes the query and waits for the next<br />

operator action.<br />

Fires In<br />

Fetch Records<br />

See Process Flowcharts<br />

Post-Query trigger examples<br />

Example<br />

This example retrieves descriptions for code fields, for display in non-database items in the current<br />

block.<br />

DECLARE<br />

472<br />

CURSOR lookup_payplan IS SELECT Payplan_Desc<br />

FROM Payplan<br />

WHERE Payplan_Id =

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!