DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: ORA-04091

  1. #1
    Join Date
    Nov 2000
    Location
    Israel
    Posts
    268
    Hi,
    I have a complex problem.
    I am having trouble with triggers in Oracle.
    I have Table a (parent) and Table b (child).
    I want to update a certain column in the parent table, after each delete in the child, by querying all the instances of the parent in the child table. (patient (parent) - study (child) i.e. for each patient there are a number of studies).

    I have a trigger after delete on the child table that triggers an update on the parent table at a certain column (which is composed of all child instances for that specific row in the database).

    I keep getting ORA-04091 errors because i am performing a select on the table from which the trigger was fired.

    What do i do ???

    Thanx
    Rotem.

  2. #2
    Join Date
    Feb 2001
    Posts
    49

    4091 error

    A trigger (or a user defined plsql function that is referenced in this statement) attempted to look at (or modify) a table that was in the middle of being modified by the statement
    Make sure that modifications are permanent (in the sense commit has been issued) before executing trigger.

    So rewrite the trigger and see.

    HTH.

    I love dba job

  3. #3
    Join Date
    Feb 2001
    Posts
    180
    Hi,
    I don't know the exact solution by heart, but I've seen
    examples by saving all the changes in a PL/SQL table
    with the AFTER INSERT/DELETE/UPDATE FOR EACH ROW-trigger and finaly process the contents of the PL/SQL-table in the AFTER INSERT/DELETE/UPDATE table-trigger.

    Success
    Regards
    Ben de Boer

Posting Permissions

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


Click Here to Expand Forum to Full Width