Author |
Message
|
jamesyu |
Posted: Wed May 20, 2009 8:53 am Post subject: Declare an Error Handler in ESQL |
|
|
Acolyte
Joined: 31 Jan 2007 Posts: 70
|
I have a Compute node and a Sub flow. The Sub flow is connected to an Out terminal of the Compute node. Within the Compute node, I build a request and propagate this request message to the Sub flow.
Some User Exceptions may be thrown out from this Sub flow that I want to ignore them and continue processing after the PROPAGATE statement within my compute node.
If I declare an Error Handle within the Compute node (ESQL), can this handler catch the excpetions occurred from the Sub flow?
Thanks,
James |
|
Back to top |
|
 |
mgk |
Posted: Wed May 20, 2009 8:56 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Yes, as long as you PROPAGATE within the scope of the handler. _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
jamesyu |
Posted: Wed May 20, 2009 9:01 am Post subject: |
|
|
Acolyte
Joined: 31 Jan 2007 Posts: 70
|
mgk wrote: |
Yes, as long as you PROPAGATE within the scope of the handler. |
Oh, within the scope of the handler! like:
BEGIN
DECLARE CONTINUE HANDLER FOR SQLSTATE LIKE'%' BEGIN END;
DECLARE x CHAR;
set x = '1';
...
PROPAGATE;
...
END;
Right? This is what I am missing! |
|
Back to top |
|
 |
mgk |
Posted: Wed May 20, 2009 9:06 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Yes  _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
jamesyu |
Posted: Wed May 20, 2009 9:12 am Post subject: |
|
|
Acolyte
Joined: 31 Jan 2007 Posts: 70
|
mgk wrote: |
Yes  |
BEGIN
DECLARE CONTINUE HANDLER FOR SQLSTATE LIKE'%' BEGIN END;
DECLARE x CHAR;
set x = '1';
...
PROPAGATE; -- calls a sample sub flow which is always throws out a User Exception
DECLARE y CHAR;
set y = '1';
...
END;
I am expecting that control goes back to the statement right after the PROPAGATE in this case, but it never stops there with a breakpoint enabled just besides "set y = '1'";
Do you happen to know why? |
|
Back to top |
|
 |
|