explain on trigger

swakoo

Member²
i had just started learning stored procedure and i am interested in trigger..
can anyone explain to me what is the differents btw procedure and trigger?
what is the advantage and disadvantage btw the 2?
thanks
 
The PL/SQL code of a trigger is called when a specific event occurs (e.g. an insert in a specific table). The PL/SQL code of procedure can be called anywhere and anytime, for example from a client application, from other procedures, or from a trigger. As a general rule you should put all your PL/SQL code in procedures, functions or packages. The PL/SQL code in triggers should be restricted to the actual trigger logic (e.g. "if this column has changed, call this procedure").
 
Back
Top