Re: Transactions: how to handle a rollback.
you can also declare an out parameter
for example
drop procedure if exists EditarMarca/
create procedure EditarMarca(
in id_var int(11),
in newNomMarca char(15),
out res char(8))
begin
DECLARE exit handler for 1062 rollback;
set res:='error';
start transaction;
update marcaProd set nomMarca=newNomMarca where idMarca=id_var;
commit;
set res:='ok';
end/
when you have an error the handler goes out the SP and you have the string 'error' in the out parameter and you will know if it did it ok or not
that SP works
Edited 1 time(s). Last edit at 11/03/2005 06:20PM by gustavo bellino.
Subject
Views
Written By
Posted
2754
October 30, 2005 12:39PM
1681
October 31, 2005 06:45AM
1674
October 31, 2005 02:57PM
Re: Transactions: how to handle a rollback.
1769
November 03, 2005 06:19PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.