Error checking // List of all errors
Ivan Smahin
ivan_smahin at paradigmasoft.com
Fri Sep 21 06:02:11 CDT 2007
Hello Bart,
Friday, September 21, 2007, 1:17:35 PM, you wrote:
> On 21-sep-07, at 12:08, Ivan Smahin wrote:
>> Hello Ruslan,
>>
>> Friday, September 21, 2007, 12:28:21 PM, you wrote:
>>
>>> On 21/9/07 12:19 PM, "Bart Pietercil" <bart.pietercil at gmail.com>
>>> wrote:
>>
>>>> Is this possible ? If yes were can I find the list of all possible
>>>> errors ?
>>
>>> List of all erros is in
>>
>>> Vcomponents/vresources/*.xml
>>
>> Plus user defined states (reserved 0x50000 - 0x50999 range ).
>> It gives you ability to raise your own errors inside SP.
>> (I.e. you can not raise unique_violation error but you can RAISE 50000
>> 'Error1' or RAISE 50001 'Error2' and so on )
> That part I understood thank you
> Question is if I have a stored Procedure sp_ExceptionHandler(In
> ExceptionNumber Long)
> Begin
> case ExceptionNumber = 1
> case .....
> end
> can I call it from another stored procedure
> sp_SomeProcedure()
> Begin
> ....
> Exception
> call sp_ExceptionHandler(ExceptionNumber)------> where do I get the
> exceptionnumber from?
> End
> And of course COULD this work?
Ok. Let's discuss it more detailed.
We can solve it just now in such a way:
...
EXCEPTION
WHEN 50000 THEN
SET errNumber = SELECT lastError();
SET errMessage = SELECT lastErrorMsg();
CALL errHandler( errNumber, errMessage );
WHEN OTHERS THEN
SET errNumber = SELECT lastError();
SET errMessage = SELECT lastErrorMsg();
CALL errHandler( errNumber, errMessage );
END;
Is it good enough?
Any ideas?
--
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