Trigger - Definition - Database

Q.  What is a trigger?
- Published on 27 Aug 15

a. It is a procedural code which is executed automatically in response to certain events on a particular table or view.
b. Statement that enables to start any DBMS.
c. Condition the system tests for the validity of the database user.
d. Statement that is executed by the user when debugging an application program.

ANSWER: It is a procedural code which is executed automatically in response to certain events on a particular table or view.
 

    Discussion

  • Nirja Shah   -Posted on 02 Nov 15
    - You can write triggers that fire whenever one of the following operations occurs:

    1. DML statements (INSERT, UPDATE, DELETE) on a particular table or view, issued by any user

    2. DDL statements (CREATE or ALTER primarily) issued either by a particular schema/user or by any schema/user in the database

    3. Database events, such as logon/logoff, errors, or startup/shutdown, also issued either by a particular schema/user or by any schema/user in the database

    - Triggers are similar to stored procedures.

    - A trigger stored in the database can include SQL and PL/SQL or Java statements to run as a unit and can invoke stored procedures.

    - However, procedures and triggers differ in the way that they are invoked.

    - A procedure is explicitly run by a user, application, or trigger.

    - Triggers are implicitly fired by Oracle when a triggering event occurs, no matter which user is connected or which application is being used.

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)