Results 1 to 6 of 6

Thread: is it possible to call a procedure (with commit and rollback stmt) inside a trigger

  1. #1
    Junior Member
    Join Date
    May 2008
    Answers
    1

    is it possible to call a procedure (with commit and rollback stmt) inside a trigger

    is it possible to call a procedure (with commit and rollback statement) inside a trigger.


  2. #2
    Expert Member
    Join Date
    Sep 2007
    Answers
    697

    Re: is it possible to call a procedure (with commit and rollback stmt) inside a trigg

    Quote Originally Posted by rph.cap View Post
    is it possible to call a procedure (with commit and rollback statement) inside a trigger.
    A procedure called by a trigger cannot contain TCL commands.

    Trying to call such a procedure from trigger will throw an error

    ORA-04091: table SCOTT.Emp_tab is mutating, trigger/function may not see it.

    Last edited by krishnaindia2007; 05-22-2008 at 04:32 AM.

  3. #3
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    Re: is it possible to call a procedure (with commit and rollback stmt) inside a trigg

    try to use autonomous trigger for the purpose.


  4. #4
    Contributing Member
    Join Date
    Mar 2008
    Answers
    66

    Re: is it possible to call a procedure (with commit and rollback stmt) inside a trigg

    Quote Originally Posted by debasisdas View Post
    try to use autonomous trigger for the purpose.

    But it is not advisable to use.


  5. #5
    Junior Member
    Join Date
    May 2008
    Answers
    7

    Re: is it possible to call a procedure (with commit and rollback stmt) inside a trigg

    Yes,It is possible by using AUTONOMOUS_TRANSACTION.


  6. #6
    Expert Member
    Join Date
    Sep 2007
    Answers
    697

    Re: is it possible to call a procedure (with commit and rollback stmt) inside a trigg

    Yes, You can call a procedure with commit from a trigger using autonomous transaction.

    An autonomous transaction is an independent transaction that is initiated by another transaction.Autonomous transactions allow a single transaction to be subdivided into multiple commit/rollback transactions, each of which will be tracked seperately.If it is not properly handled it may lead to data corruption.


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