Hi, I m new in sql anywhere 12 database. I cant find out how to catch error inside stored procedure. In MSSQL I use BEGIN TRY -- code to do END TRY -- code to log error and return error message to client END How to do something similar in sql anywhere 12 stored procedure? I m using T-SQL syntax. Thx Tomaz |
I try to use example from help but this is not generic error handling. If I get it right is needed to declare error type before executing code? Is it posible that server return message what kind of error happend inside BEGIn END?
(24 Dec '12, 06:30)
tomazs
|
Thx. This work only if I select Watcom-sql but I want to write procedures in Transact SQL. I could probably check SQLSTATE or SQLCODE aftter every statment but this is what we do yeas ago :0))
(24 Dec '12, 06:23)
tomazs
TSQL in SA oly for compatibility with ASE. ASE as I know don't support try/catch blocks.
(24 Dec '12, 07:03)
AlexeyK77
Aha, so is it better switch to Watcom SQL? I stuck on first procedure :0)) so not lot to recreate.
(24 Dec '12, 07:20)
tomazs
Replies hidden
2
Yes... I think everyone here will agree that Watcom SQL is a much improved syntax... more features, especially.
(24 Dec '12, 10:12)
Breck Carter
|
Just a few more hints:
|