01-02-2013, 03:29 PM
HIGH LEVEL LANGUAGE EXTENSIONS WITH TRIGGERS
HIGH LEVEL LANGUAGE.docx (Size: 15.8 KB / Downloads: 22)
AIM: -
To study and execute Triggers in RDBMS.
Definition & Syntax: -
TRIGGER
A database trigger is a stored procedure that is fired when an insert, update or delete statement is issued against the associated table. Database triggers can be used for the following purposes.
To generate data automatically.
To enforce complex integrity constraints. (e.g. Checking with sysdate, checking with data in another table).
To customize complex security authorizations.
To maintain replicate tables.
To audit data modifications.
PARTS OF A TRIGGER
A database trigger has three parts, namely, a trigger statement, a trigger body and a trigger restriction.
TRIGGER STATEMENT: -
A trigger statement specifies the DML statements like update, delete and insert and it fires the trigger body. It also specifies the table to which the trigger is associated.
TRIGGER BODY: -
Trigger body is a PL/SQL block that is executed when a triggering statement is issued.
TRIGGER RESTRICTION: -
Restrictions on a triggers can be achieved using the WHEN clause as shown in the syntax for creating triggers. They can be included in the definition of a row trigger, where in, the condition in the WHEN clause is evaluated for each row that is affected by the trigger.
RESULT:
Thus the usage of trigger were studied and executed in RDBMS.