dbTalk Databases Forums  

error catching problem

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss error catching problem in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
nemo
 
Posts: n/a

Default error catching problem - 05-19-2010 , 03:26 AM






Hi,

in every function/procedure i write i add this to catch errors:
EXCEPTION
WHEN OTHERS THEN
SET @err = cast(SQLSTATE as TEXT);
call log_err(@err,'function name');

It writes to log file SQLSTATE error. But all I have is number... for
example:
I know that 52003 is Column '%1' not found, but what can I do to catch
this column name? How to retrieve %1, %2 and so on?

Plz help

Adam

Reply With Quote
  #2  
Old   
tduemesnil
 
Posts: n/a

Default Re: error catching problem - 05-20-2010 , 05:54 AM






On 19 Mai, 10:26, nemo <adam.samborow... (AT) gmail (DOT) com> wrote:
Quote:
Hi,

in every function/procedure i write i add this to catch errors:
* * EXCEPTION
* * * * WHEN OTHERS THEN
* * * * * * * * SET @err = cast(SQLSTATE as TEXT);
* * * * * * * * call log_err(@err,'function name');

look for the ERRORMSG() function

Regards
Thomas

Reply With Quote
  #3  
Old   
nemo
 
Posts: n/a

Default Re: error catching problem - 05-20-2010 , 09:34 AM



On 20 Maj, 12:54, tduemesnil <tduemes... (AT) googlemail (DOT) com> wrote:
Quote:
On 19 Mai, 10:26, nemo <adam.samborow... (AT) gmail (DOT) com> wrote:> Hi,

in every function/procedure i write i add this to catch errors:
* * EXCEPTION
* * * * WHEN OTHERS THEN
* * * * * * * * SET @err = cast(SQLSTATE as TEXT);
* * * * * * * * call log_err(@err,'function name');

* look for the *ERRORMSG() function

Regards
Thomas
Great, this is what I was looking for. Thanks

Adam

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.