on 01-13-2016 5:05 PM
Hi everyone,
I'm struggling a bit with signalling.
I have a procedure that calls two other procedures. Lets call them Procedure Main, that calls Procedure 1 and Procedure 2.
Now, what I need is to signal an exception from Procedure 1 to Procedure Main.
What's happening is that, even though I have a declare exit handler for SQLEXCEPTION in Procedure Main, when I signal the exception in Procedure 1, it's going to blow up to process and not execute Procedure 2.
Is there some way to achieve this?
Thank you,
Fábio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Fábio
One way probably you could do this by handling exception in your proc1 as out put parameter.
This is what I did..
First time if I call this procedure, it would give me 'inserted successfully' message at out put .
But, if I call this second time, it should give me Error Code as output.
You just need to catch this Error Code in calling procedure ( main one ) and then process a IF-THEN-ELSE block. .
First Time Call:
Second call gives me out put 301 , which is the error code for Unique Key Constraint violation .
Hope this helps
Cheers
Anindya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.