© 2014 Firstsoft Technologies (P) Limited. login
Hi 'Guest'
Home SiteMap Contact Us Disclaimer
enggedu
Quick Links
Easy Studies


High level language extension with Triggers

Triggers are a special construct similar to Procedures. Triggers became famous due to their use in PL/SQL - the programming language that comes with the ORACLE DBMS. Procedures are executed when they are invoked from the outside by a program or another procedure while a Trigger is executed whenever the 'triggering' event set to start it takes place. In the ORACLE DBMS, The triggering event could be an INSERT, DELETE, or UPDATE SQL command. The timing of the trigger can either be BEFORE or AFTER one of these commands. Row level triggers take place once for each row affected by the triggering statement while statement level triggers fire just once for per UPDATE query.
Trigger Example
SQL> ed
Wrote file afiedt.buf
  1   CREATE OR REPLACE
  2  TRIGGER PERSON_INSERT_AFTER
  3   AFTER
  4   INSERT
  5   ON emps
  6   FOR EACH ROW
  7   BEGIN
  8   DBMS_OUTPUT.PUT_LINE ('AFTER INSERT OF' ||:NEW.ENAME);
  9   END;
SQL> /
Trigger created.
SQL> insert into emps values ('john', 12, 11990);
1 row created.
SQL>

 
SLogix Student Projects
bottom