I have to agree with Serge here. For instance, if your procedure gets a
-1224 SQLCODE (no database agent -- typically meaning your connection
has been forced), coding up a continue handler, especially if you're
processing result data inside the procedure, can mean your procedure
will loop forever. The negative offshoot of that is that at best you'll
have an db2fmp process orphaned on your system (for any FENCED
procedure) or at worst the agent won't be able to be forced off as
control is inside the procedure (for any NOT FENCED LANGUAGE C
procedure, or SQL procedures created pre-V82 ie FP7).
Serge Rielau wrote:
vj wrote:
Please let me know how can i handle any kind of error conditions with a
single (condition and continue handler).
I need to catch any kind of exception thrown in the procedure with
a single
( declare condition and a declare continue handler)
Thanks in advance.
Vijay
That should do it:
DECLARE CONTINUE HANDLER FOR SQLWARNING, SQLEXCEPTION, NOT FOUND
...
Keep me on record for saying that this is a really bad idea.
Cheers
Serge