Please be aware that the SAP SQL Anywhere Forum will be shut down on August 29th, 2024 when all it's content will be migrated to the SAP Community.

Where can i see the errors encountered by my database e.g. an insert/ update failed is there an error log somewhere i can check or can i define a file coz i have stored procedures which when called are not executing sometimes but when i execute "manually" from ISQL it works. So want to see why sometimes it fails or when client applications fail to log in.

asked 22 Sep '11, 13:29

Takudzwa's gravatar image

Takudzwa
818813
accept rate: 0%

edited 22 Sep '11, 14:44

Volker%20Barth's gravatar image

Volker Barth
40.5k365556827


This FAQ may give you some hints.

In general, SQL errors are returned to the calling environment, so in DBSIQL you get an error message, and within an application, the API gives you the chance to get and handle error messages as desired.

Within procedures and triggers, you can also use error handlers to handle any error. This may include to log them in the server console file (dbsrv12 -o logfile.txt) or another file of your choice.

permanent link

answered 22 Sep '11, 14:40

Volker%20Barth's gravatar image

Volker Barth
40.5k365556827
accept rate: 34%

edited 22 Sep '11, 14:47

1

Don't forget that you can also create an in-database table to record error messages -- much easier to search and manage than the console output, at least as long as the database is accessible.

(22 Sep '11, 16:55) William Clardy
Replies hidden
1

Yes, but in case of failing statements (or failing connections) transactions may be rolled back, and that means one might rollback the error-table entries as well.

So it may be helpful to use a separate connection to log such errors, e.g. by using an event (which runs in its own connection by design) to do so. - Of course that would be oversized when one just wants to log "somewhat expected errors", and error handlers are able to cope with them...

(22 Sep '11, 17:09) Volker Barth

Good point about transactions rollbacks being an issue -- I hadn't thought of that gotcha on the more severe oopses.

(22 Sep '11, 17:33) William Clardy
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×439
×95
×44

question asked: 22 Sep '11, 13:29

question was seen: 2,371 times

last updated: 22 Sep '11, 17:33