SQL Error Text Capture in Stored Proc
Posted in 1999
Topics: Stored Procedures & SPL
Is it possible to retrieve the sql error text resulting from an error in a stored procedure within a stored procedure? I would like to log any errors during execution of an SP to a table using another error logging SP called within an "on exception" block. However, the error text that is captured from setting the three values following the "on exception" statement is not very useful. I would like to do something akin to capturing "finderr" output, but this requires a return from a system call -- which is no possible to do. Has anybody else attempted to do this? Your help would be appreciated. TIA
You could create a table which contains all error message using a tool named 'errmsgtbl". It can be found in the IIUG archive. Then you can easily select the appropriate error text for your sqlcode in the exception handler. hth, Chris