A script-enabled browser is required for this page to function properly.

About Database Trigger Processing

Recall that database triggers fire in response to a DML statement such as INSERT, UPDATE, or DELETE. So during normal Oracle Forms commit-time processing, as Oracle Forms issues INSERT statements to add newly entered records to the database, UPDATE statements to effect changes by the operator to existing records, and DELETE statements to remove records deleted by the operator from the database; database triggers will fire if enabled.

For example, consider the scenario where the following database triggers have been defined and enabled on the EMP table:

When the operator deletes a record that has been queried, the following sequence of events occurs:

  1. Oracle Forms locks the record to be deleted.
  2. Operator presses [Commit].
  3. Oracle Forms fires the PRE-COMMIT trigger.
  4. Oracle Forms fires the PRE-DELETE trigger.
  5. Oracle Forms issues a DELETE statement to delete the row.
  6. The database fires the BEFORE DELETE trigger.
  7. The database fires the BEFORE DELETE FOR EACH ROW trigger.
  8. The database deletes the record.
  9. The database fires the AFTER DELETE FOR EACH ROW trigger.
  10. The Database AFTER DELETE trigger fires.
  11. Oracle Forms fires the POST-DELETE trigger.
  12. Oracle Forms fires the POST-COMMIT trigger.

Recall that any error raised during Commit processing causes Oracle Forms to roll back the currently committing transaction to the savepoint that was issued when the Commit sequence began. If any Database trigger fails (by raising an unhandled error or calling a RAISE_APPLICATION_ERROR) as a result of a DML statement that Oracle Forms has issued automatically, then an "Oracle Error Occurred ..." message will appear. An error raised as a result of a DML statement in your PL/SQL trigger, on the other hand, can be handled gracefully. If not handled, the error will produce the message: "XXX-YYYYYY trigger raised unhandled exception."


About database triggers

Creating a database trigger