cancel
Showing results for 
Search instead for 
Did you mean: 

what is the expected behaviour? try/catch and EXCEPTION

Former Member
2,117

It's late Friday afternoon and things are not working as I think it should or I could just be tired and can not think straight, so I would be happy for some help, thanks in advance ...

I want to know the expected behaviour for try/catch and EXCEPTION

I thought:

CREATE PROCEDURE DUMMIE
BEGIN TRY
    ---calls other functions which makes different inserts
END TRY
BEGIN CATCH
   -- If the inserts fails I end up here without any display of error       
   -- messages
   -- I can do rollback and call another procedure which does a      
   -- insert and do commit
END CATCH;

Is this wrong?

What I get: when the inserts fails I get an pop-up with an error message but I also end up in catch section, but the procedures are not called...

and I can also add that this procedure should be used in a scheduled job...scheduled event

EXCEPTION

If I only got (in my procedure)

EXCEPTION WHEN OTHERS THEN

shouldn't this catch all types of errors in the procedure without displaying any error messages? And I would then be able to do rollback and call other procedures, do commit??

Accepted Solutions (0)

Answers (0)