What is a Trigger ?

 A piece of logic that is executed at or triggered by a SQL *forms event. 

Showing Answers 1 - 12 of 12 Answers

maromaro2

  • Nov 12th, 2006
 

Triggers are a special PL/SQL construct similar to procedures. However, a procedure is executed explicitly from another block via a procedure call, while a trigger is executed implicitly whenever the triggering event happens. The triggering event is either a INSERT, DELETE, or UPDATE command. The timing can be either BEFORE or AFTER. The trigger can be either row-level or statement-level, where the former fires once for each row affected by the triggering statement and the latter fires once for the whole statement.

  Was this answer useful?  Yes

A forms trigger is a block of PL/SQL code that adds functionality to your
application. Triggers are attached to objects in your application. When a
trigger is fired, it executes the code it contains. Each trigger’s name defines
what event will fire it; for instance, a WHEN-BUTTON-PRESSED trigger executes
its code each time you click on the button to which the trigger is attached. Or,
we can say, a forms trigger is a set of PL/SQL actions that happen each time an
event such as when-checkbox-changed, when-button-pressed, or
when-new-record-instance occurs. You can attach several triggers to a data
query. The most popular of them are the PRE-QUERY and POST-QUERY.


PRE-QUERY and POST-QUERY trigger


The PRE-QUERY trigger fires before the select statement is finalized. The
POST-QUERY trigger fires before selected records are presented to the user. It
fires after records are retrieved but before they are displayed. So, you can use
it to enhance a query’s records in a number of ways. Your Post-Query trigger can
contain code to calculate or populate control items.


PRE-INSERT and WHEN-NEW-FORM-INSTANCE trigger


Some other useful triggers are: PRE-INSERT and WHEN-NEW-FORM-INSTANCE.
A PRE-INSERT trigger fires once before each new record is inserted in a commit
process. The "WHEN-NEW-FORM-INSTANCE" trigger will be used to prepare objects or
an action when entering to a new form. It fires when the form is entered.

  Was this answer useful?  Yes

Bashartullakhan

  • Aug 17th, 2011
 

Triggers are a special PL/SQL construct similar to procedures. However, a procedure is executed explicitly from another block via a procedure call, while a trigger is executed implicitly whenever the triggering event happens. The triggering event is either a INSERT, DELETE, or UPDATE command.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions