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.

On-Delete trigger<br />

Description<br />

Fires during the Post and Commit Transactions process and replaces the default <strong>Form</strong> <strong>Builder</strong> processing<br />

for handling deleted records during transaction posting. Specifically, it fires after the Pre-Delete trigger<br />

fires and before the Post-Delete trigger fires, replacing the actual database delete of a given row. The<br />

trigger fires once for each row that is marked for deletion from the database.<br />

Definition Level form or block<br />

Legal Commands<br />

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

Enter Query Mode no<br />

Usage Notes<br />

• Use an On-Delete trigger to replace the default <strong>Form</strong> <strong>Builder</strong> processing for handling deleted<br />

records during transaction posting.<br />

• To perform the default <strong>Form</strong> <strong>Builder</strong> processing from this trigger, that is, to delete a record from<br />

your form or from the database, include a call to the DELETE_RECORD built-in.<br />

On Failure<br />

<strong>Form</strong> <strong>Builder</strong> rolls back to the most recent savepoint<br />

Fires In<br />

Post and Commit Transactions<br />

See Process Flowcharts<br />

On-Delete trigger examples<br />

Example<br />

This example updates the employee table to set the Termination_Date, rather than actually deleting the<br />

employee from the database.<br />

BEGIN<br />

UPDATE emp<br />

SET termination_date = SYSDATE<br />

WHERE empno = :Emp.Empno;<br />

IF form_fatal OR form_failure THEN<br />

raise form_trigger_failure;<br />

END IF;<br />

END;<br />

442

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

Saved successfully!

Ooh no, something went wrong!