12.07.2015 Views

Oracle SQL Developer

Oracle SQL Developer

Oracle SQL Developer

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Create Trigger3.18 Create TriggerThe following information applies to a trigger, which is which is a stored PL/<strong>SQL</strong>block associated with a table, a schema, or the database, or an anonymous PL/<strong>SQL</strong>block or a call to a procedure implemented in PL/<strong>SQL</strong> or Java. The trigger isautomatically executed when the specified conditions occur.Trigger Owner: Database schema in which to create the trigger.Name: Name of the trigger. Must be unique within the database.Trigger Type: The type of object on which to create the trigger: TABLE, VIEW,SCHEMA, or DATABASE. (The remaining items depend on the type of trigger.)Table Owner or View Owner: For a trigger on a table or a view, the name of the ownerof the table or the view.Table Name or View Name : For a trigger on a table or a view, the name of the table orthe view.Before or After: For a trigger on a table, select Before to cause the database to fire thetrigger before executing the triggering event, or select After to cause the database tofire the trigger after executing the triggering event.Statement Level or Row Level: For a trigger on a table, Statement Level fires thetrigger once before or after the triggering statement that meets the optional triggerconstraint defined in the WHEN condition; Row Level fires the trigger once for eachrow that is affected by the triggering statement and that meets the optional triggerconstraint defined in the WHEN condition.Insert, Update, Delete: For a trigger on a table or a view, Insert fires the triggerwhenever an INSERT statement adds a row to a table or adds an element to a nestedtable; Update fires fire the trigger whenever an UPDATE statement changes a value inone of the columns specified in Selected Columns (or in any column if no columns arespecified); Delete fires the trigger whenever a DELETE statement removes a row fromthe table or removes an element from a nested table.Referencing - Old: For a trigger on a table, the correlation names in the PL/<strong>SQL</strong> blockand WHEN condition of a row trigger to refer specifically to old value of the currentrow.Referencing - New: For a trigger on a table, the correlation names in the PL/<strong>SQL</strong>block and WHEN condition of a row trigger to refer specifically to new value of thecurrent row.Available Columns: For a trigger on a table, lists the columns from which you canselect for use in an Update trigger definition.Selected Columns: For a trigger on a table, lists the columns used in an Update triggerdefinition.When: For a trigger on a table, an optional trigger condition, which is a <strong>SQL</strong> conditionthat must be satisfied for the database to fire the trigger. This condition must containcorrelation names and cannot contain a query.Schema: For a trigger on a schema, the name of the schema on which to create thetrigger.Available Events: For a trigger on a schema or database, lists events from which youcan select for use in the trigger definition.Selected Events: For a trigger on a schema or database, lists events used in the triggerdefinition.Dialog Boxes for Creating/Editing Objects 3-17

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

Saved successfully!

Ooh no, something went wrong!