Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: triggers

Re: triggers

From: Randy A. Stebbins <randys_at_triax.com>
Date: 1997/06/13
Message-ID: <01bc77ac$ed16b5a0$146930cf@default>#1/1

Chadi ElKadri <chadi_elkadri_at_nt.com> wrote in article <3397191B.28E2_at_nt.com>...
> Hi
> I need help on the usage of triggers...
>

I need more detail to answer the question well, but I can begin. Triggers are code stored in the database and set to run when an event occurs. When the trigger runs, it is said to "fire". Triggers are attached to a table and a particular event (such as a delete, update, or insert). They can be set to run once for each row involved in the event, or once per SQL statement, regardless of the number of rows affected. They can be set to occur before or after the database update. Triggers are written in PL/SQL and are compiled when used. It is therefore wise to keep them short. If they need to be more than a few lines long, it is much better to create stored procedures or functions and to call them from the triggers. Triggers do have one major "gotcha". You cannot use a trigger to access other rows in tables involved in the transaction. This causes a "mutating table" error.

Hope this helps to get you started on more detailed questions. Received on Fri Jun 13 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US