If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > How to use transaction in Stored Procedure ?

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-24-10, 16:09
dicipulofer dicipulofer is offline
Registered User
 
Join Date: Oct 2007
Posts: 53
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;
Reply With Quote
  #2 (permalink)  
Old 03-13-10, 06:44
Tyveleyn Tyveleyn is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On