Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2007
    Posts
    61

    Unanswered: How to use transaction in Stored Procedure ?

    Hi,

    I'm trying to use transactions in my stored procedure without sucess.

    I'm trying. It's complile, but not work when I call this procedure inside other procedure.


    CREATE PROCEDURE xx (p_item char(15),p_versao integer) RETURNS INTEGER
    DEFINE v_erro integer;

    begin work;
    BEGIN


    on exception set v_erro
    return v_erro;
    end exception with resume


    delete from x;

    commit work;

    end
    end procedure;

  2. #2
    Join Date
    Aug 2006
    Location
    The Netherlands
    Posts
    248
    Hi,

    all operations within a single or chain of stored procedures are performed within an implicit transaction. If an exception occurs in the stored procedure thats called from another stored procedure actions of both procedures are rolled back.

    Regards,
    Hans

Posting Permissions

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