Results 1 to 9 of 9

Thread: what is trigger

  1. #1
    Junior Member
    Join Date
    Apr 2007
    Answers
    1

    what is trigger

    hi ,
    pls send immediatly


  2. #2
    Contributing Member
    Join Date
    Apr 2007
    Answers
    58

    Re: what is trigger

    A trigger is a function containing sql statements/commands which will be executed when a predefined condition occurs. Its same like functions in other programming languages but here it is made up of sql statements/commands instead of program commands.

    An example of a simple before statement-level trigger that displays a message prior to an insert operation on the emp table.

    Create or replace trigger emp_alert_trig ......................; trigger name
    before insert on emp ................................................; action which starts this trigger
    begin....................................................................... ; commands to be executed.
    Dbms_output.put_line('new employees are about to be added');
    end;

    Last edited by Haitalk; 04-04-2007 at 02:45 AM.
    Regards,
    Anoop :)
    If its useful, dont forget to [COLOR="Red"]THANK[/COLOR] me :cool:

  3. #3

    Re: what is trigger

    A trigger is a block of statements that includes a set of SQL statements. Statements in a trigger are activated or executed in response to data modification operations. A trigger defined on a table is fired when data modification statements, such as insert, update, or delete, modify data in that table

    Triggers maintain the consistency of related data in a table. As a result, triggers maintain referential integrity of data in a database. Referential integrity ensures that each primary key in a table has a corresponding foreign key that matches exactly with the primary key. A primary key is a unique identifier in a table.

    Triggers are fired automatically. They are specific to data modification commands, such as insert, update, and delete. Triggers are fired when you execute data modification statements. You can roll back both a trigger and the SQL statement that fires the trigger in a single transaction in the trigger. The entire transaction is rolled back if an error occurs.


  4. #4
    Junior Member
    Join Date
    Feb 2007
    Answers
    17

    Re: what is trigger

    a trigger is a set of Structured Query Language (SQL) statements that automatically "fires off" an action when a specific operation, such as changing data in a table, occurs. A trigger consists of an event (an INSERT, DELETE, or UPDATE statement issued against an associated table) and an action (the related procedure). Triggers are used to preserve data integrity by checking on or changing data in a consistent manner.


  5. #5
    Junior Member
    Join Date
    Feb 2007
    Answers
    17

    Re: what is trigger

    An action causing the automatic invocation of a procedure, for instance to preserve {referential integrity}. A triggers goes into effect when a user attempts to modify data with an insert, delete, or update command. A trigger can instruct the system to take any number of actions when a specified change is attempted. By preventing incorrect, unauthorized, or inconsistent changes to data, triggers help maintain the integrity of the database.


  6. #6
    Moderator
    Join Date
    Sep 2006
    Answers
    920

    Re: what is trigger

    A database trigger is procedural code that is automatically executed in response to certain events on a particular table in a database.

    A trigger can also used for execution of stored procedures at required times.

    Regards,
    Brijesh Jain
    ---------------------------------------------------------
    Connect with me on Skype: jainbrijesh
    Google Plus : jainbrijeshji

  7. #7
    Contributing Member
    Join Date
    May 2007
    Answers
    60

    Re: what is trigger

    Hi,

    I will tell u simple answer for trigger. Trigger is a special type of stored procedure it can be called implicitly when ever u perform DML operations(Insert,Delete,Update) on to the table.

    Regards,
    hari prasad


  8. #8
    Junior Member
    Join Date
    Jun 2007
    Answers
    1

    Re: what is trigger

    A trigger is an event handler against some specific event.

    when that event is raised a code is executed


  9. #9
    Junior Member
    Join Date
    Jan 2008
    Answers
    24

    Re: what is trigger

    it is in object in database which is automatically executed at the specified event.
    3 types triggers are there
    DML triggers
    DDL triggers
    Database triggers


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact