Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2003
    Posts
    2

    Unanswered: another trigger problem

    I have a question about triggers, I have been trying to answer for a class I'm taking...

    "In an employee information table, I have defined 2 triggers to monitor the user access by inserting records into an auditing table, whenever SQL update is performed. I had to increase the salary of 20 employees in Sales so I used 'update' to complete the request. The auditing table found 21 new records, which were inserted into table by triggers defined previously. I need to know what type of trigers are defined and how they fire when updating. What caqnnot you determine about the triggers according to info provided?"

    I know that this is a row trigger which fires for each row updated. I assume that you can not tell if it fires before or after the update. Is there anything else I'm missing? Also, I am not sure why the auditing table found 21 new records, is it becuase the first was a login record? any assistance greatly appreciated. Thanks-

  2. #2
    Join Date
    Dec 2003
    Posts
    74
    to find out what triggers are on a table look @ the user_triggers table.
    you can associate what table owns what triggers from this table.

    desc user_triggers

    Name
    -----------------------
    TRIGGER_NAME
    TRIGGER_TYPE
    TRIGGERING_EVENT
    TABLE_OWNER
    BASE_OBJECT_TYPE
    TABLE_NAME
    COLUMN_NAME
    REFERENCING_NAMES
    WHEN_CLAUSE
    STATUS
    DESCRIPTION
    ACTION_TYPE
    TRIGGER_BODY

    so to find out what triggers and type are associated with the table emp type the following:

    select trigger_name,trigger_type from user_triggers where table_owner = 'EMP';

    There are different trigger types then:
    BEFORE INSERT
    AFTER INSERT
    BEFORE DELETE
    AFTER DELETE
    BEFORE UPDATE
    AFTER UPDATE

    So from you email it sounds like you updated a record which would create a journal record and then update the whole 20 records.

    Hopes this helps

  3. #3
    Join Date
    Dec 2003
    Posts
    2
    okay, thanks for your help..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •