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. |
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. 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
|