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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Post-<strong><strong>Form</strong>s</strong>-Commit trigger<br />

Description<br />

Fires once during the Post and Commit Transactions process. If there are records in the form that have<br />

been marked as inserts, updates, or deletes, the Post-<strong><strong>Form</strong>s</strong>-Commit trigger fires after these changes have<br />

been written to the database but before <strong>Form</strong> <strong>Builder</strong> issues the database Commit to finalize the<br />

transaction.<br />

If the operator or the application initiates a Commit when there are no records in the form have been<br />

marked as inserts, updates, or deletes, <strong>Form</strong> <strong>Builder</strong> fires the Post-<strong><strong>Form</strong>s</strong>-Commit trigger immediately,<br />

without posting changes to the database.<br />

Definition Level form<br />

Legal Commands<br />

SELECT statements, DML statements (DELETE, INSERT, UPDATE), unrestricted built-ins<br />

Enter Query Mode no<br />

Usage Notes<br />

Use a Post-<strong><strong>Form</strong>s</strong>-Commit trigger to perform an action, such as updating an audit trail, anytime a<br />

database commit is about to occur.<br />

On Failure<br />

Aborts post and commit processing: <strong>Form</strong> <strong>Builder</strong> issues a ROLLBACK and decrements the internal<br />

Savepoint counter.<br />

Fires In<br />

Post and Commit Transactions<br />

See Process Flowcharts<br />

Post-<strong><strong>Form</strong>s</strong>-Commit trigger examples<br />

Example<br />

This example can be used in concert with the Post-Database-Commit trigger to detect if records have<br />

been posted but not yet committed.<br />

/*<br />

** FUNCTION recs_posted_and_not_committed<br />

** RETURN BOOLEAN IS<br />

** BEGIN<br />

** Default_Value(’TRUE’,’Global.Did_DB_Commit’);<br />

** RETURN (:System.<strong>Form</strong>_Status = ’QUERY’<br />

** AND :Global.Did_DB_Commit = ’FALSE’);<br />

** END;<br />

*/<br />

BEGIN<br />

:Global.Did_DB_Commit := ’FALSE’;<br />

467

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

Saved successfully!

Ooh no, something went wrong!