Re: Catching exceptions.
Posted in 1999
Aurelio
Try this:
define sql_error smallint;
define isam_error smallint;
define text_error char(80);
on exception set sql_error, isam_error, text_error
-- take the errorcode in var A, text in var B
let A = sql_error;
let B = text_error;
-- do something
-- ....
-- re-raise the exception
-- raise exception A,0,B;
raise exception sql_error, isam_error, text_error;
end
BTW, the sql_error, etc are not reserved words or anything, you could
directly set A, B, etc provided you have them setup in the same sequence.
HTH
Sujit
Aurelio <i52sacaa@uco.es> on 04/09/99 07:02:02 AM
Please respond to Aurelio <i52sacaa@uco.es>
To: informix-list@iiug.org
cc: (bcc: Sujit Pal)
Subject: Catching exceptions.
How can i catch the errorcode and text of an exception? I must use SET
clause, but I can't find any example. I would like doing something like
this:
create procedure procname()
on exception
-- take the errorcode in var A, text in var B
do something
-- re-raise the exception
raise exception A,0,B;
end
...
end procedure;