Trapping and raising errors

Ivan Smahin ivan_smahin at paradigmasoft.com
Tue Mar 3 11:29:12 CST 2009


Hello Bart,

Tuesday, March 3, 2009, 5:43:39 PM, you wrote:

> Hi List, Ruslan


> I have been thinking a lot over the next issue.

> Let's say we have a stored procedure sp1()

> create procedure sp1()
> begin
>         do lots of stuff
>         some loop also
> exception
>         when 56503 then
>                 leave
>         when others then
>                 print to log
> end

> Now lets say I call this sp() from php using vPHP.

> Question 1: do I understand correctly that vPHP' s exception handler  
> will never be called because sp1 already handled the exception ?

Yes

> If the answer to Q1 is yes then I need a way to 'reraise' the  
> exception so that vPHP's exception handler will be triggered (and the
> interface can display the error in a nice clean formated way)

You can do something like this:

...
RAISE @@LastErrorNumber, @@LastErrorMessage;



> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina



-- 
Best regards,
Ivan Smahin 
Senior Software Engineer
Paradigma Software, Inc
Valentina - The Ultra-Fast Database
http://www.valentina-db.com



More information about the Valentina mailing list