What is the syntax for creating an INSTEAD OF trigger?

Are you preparing for IT certification? With practice questions, study notes, interactive quizzes, tips and technical articles, uCertify PrepKits ensure that you get a solid grasp of core technical concepts to ace your certification exam in first attempt.

What is the syntax for creating an INSTEAD OF trigger?

Rating:

Following is the syntax for creating an INSTEAD OF trigger:

CREATE [OR REPLACE] TRIGGER trigger_name
INSTEAD OF event1 [OR event2 OR event3] ON view_name
[REFERENCING OLD AS old | NEW AS new]
[FOR EACH ROW]
trigger_body


where,

  • OR REPLACE option specifies that if the trigger already exists, it will be replaced by the new version created by the statement.

  • trigger_name is the name of the trigger.

  • INSTEAD OF clause indicates that the trigger belongs to a view.

  • view_name indicates the view associated with the trigger.

  • REFERENCING option specifies correlation names for the old and new values of the current row. The default values are OLD and NEW respectively.

  • FOR EACH ROW option designates the trigger to be a row trigger. INSTEAD OF triggers can only be row triggers. If the FOR EACH ROW option is omitted, the trigger is still defined as a row trigger.

  • trigger_body defines the action performed by the trigger. The trigger_body begins with either DECLARE or BEGIN and ends with END or a call to a procedure.


  • Note: INSTEAD OF triggers can be created only for views. BEFORE and AFTER options are not valid for an INSTEAD OF trigger.


    Rating:



    Other articles

    Click here to Article home

     
    uCertify.com | Our Company | Articles | Privacy | Security | Contact Us | News and Press Release | uCertify India
    MCSE: MCSA, MCTS, MCITP    JAVA Certification: SCJP, SCWCD Cisco Certification: CCNA, CCENT, A+, Network+, Security+
    Oracle Certification: OCP 9i, OCP 10g, OCA 9i, OCA 10g CIW foundation    EC-212-32    CISSP    Photoshop ACE    Adobe Flash ACE
    © 2008 uCertify.com. All rights reserved. All trademarks are the property of their respective owners.