Try and/or adapt this
...
exception
when @errorflag<>0 then
error := sqlcode;
memerror := sqlerrm;
insert into table_tmp_error
(col1, col2,...)
values
(error, memerror);
commit;
end;
-----Message d'origine-----
De : Ranjit [mailto:oracledba-ezmlmshield-x90818838.[Email address protected]
Envoyé : mercredi 23 novembre 2005 14:59
À : LazyDBA Discussion
Objet : transaction
Hi All,
I want to catch the error in a variable. Can you please helpme in writing
this proc.
create or replace procedure test45
is
v_sql VARCHAR2(500);
declare @errorflag int
begin
begin tran
v_sql := 'select no from ran';
EXECUTE IMMEDIATE v_sql;
if @errorflag<>0 rollback tran
else commit tran
end
regards
Ranjit S.
--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html
Oracle LazyDBA home page