12.07.2015 Views

Oracle SQL Developer

Oracle SQL Developer

Oracle SQL Developer

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

9Triggers: Usage InformationThis topic discusses the use of database triggers with <strong>Oracle</strong> Express. Triggers aredatabase objects that can be created with PL/<strong>SQL</strong> code. This topic includes thefollowing topics:■■Overview of TriggersDesigning Triggers9.1 Overview of TriggersA database trigger is a stored subprogram associated with a database table, view, orevent. The trigger can be called once, when some event occurs, or many times, once foreach row affected by an INSERT, UPDATE, or DELETE statement. The trigger can becalled after the event, to record it or take some follow-up action. Or, the trigger can becalled before the event to prevent erroneous operations or fix new data so that itconforms to business rules. The executable part of a trigger can contain proceduralstatements as well as <strong>SQL</strong> data manipulation statements.Triggers are created using the <strong>SQL</strong> CREATE TRIGGER statement. The CREATE (orCREATE OR REPLACE) statement fails if any errors exist in the PL/<strong>SQL</strong> block.■■■■■■■■See Also:■■■<strong>Oracle</strong> Database Concepts for information on triggers.<strong>Oracle</strong> Database Application <strong>Developer</strong>'s Guide - Fundamentals forinformation on triggers.<strong>Oracle</strong> Database <strong>SQL</strong> Reference for information on the CREATETRIGGER <strong>SQL</strong> statement.Types of TriggersNaming TriggersWhen Is the Trigger Fired?Controlling When a Trigger Is FiredAccessing Column Values in Row TriggersDetecting the DML Operation That Fired a TriggerEnabled and Disabled Trigger ModesError Conditions and Exceptions in the Trigger BodySee Also: <strong>Oracle</strong> Database <strong>SQL</strong> Reference for information on triggercreation syntaxTriggers: Usage Information 9-1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!