In a stored procedure I'd like to get the call hierarchy like it's shown in the tab "Call Stack" when debugging with Sybase Central. I remember having seen a system procedure or function for that, but I can't seem to find it. Can annyone point me to that procedure (or tell me my memory is wrong)? |
Are you looking for the following system function? select traceback(); Thanks Volker, that's what I was looking for. But not remembering how it's called I couldn't find any trace of it ;-)
(22 Feb '13, 07:52)
Reimer Pods
Replies hidden
Volker's answer helped me find the function I've seen before. But to my disappointment it's only result is the SQL command that was executed when an error occured. What I had in mind, was getting informations about where the error occured (procedure or trigger). But I suppose that there exists not such function, or am I wrong?
(22 Feb '13, 09:10)
Reimer Pods
Replies hidden
Well, at least we can tell you your memory is not wrong:)
(22 Feb '13, 09:36)
Volker Barth
The next version (aka Nagano) has new-and-improved error reporting & traceback functions, so check out the beta if you haven't already.
(22 Feb '13, 09:40)
Mark Culp
Thanks, Mark, I will check the new features.
(25 Feb '13, 08:00)
Reimer Pods
Replies hidden
One workaround I have thought of (but don't know whether it would work at all, and it would require work...):
As stated, I don't know whether this will work, and of course the "re-signal" would possibly interfere with the attempt to handle errors locally...
(25 Feb '13, 08:06)
Volker Barth
Volker, thank you for the suggestion. The hard part is the "relevant procedure" as that is exactly what I'm wanting to find out. The database for that application has ~600 SP and ~400 triggers created over the last 15 years, many of them lacking proper error handling. So my next step will be to try the-soon-to-be-released-version of SA (kind of "He-Who-Must-Not-Be-Named" ;-)).
(25 Feb '13, 08:47)
Reimer Pods
Replies hidden
TRACEFORWARD(), as they say:)
(25 Feb '13, 09:04)
Volker Barth
Well, I tried TRACEBACK () in Nagano beta, but to no avail, it does exactly the same as SA12, just shows the line executed when the exception was fired. So maybe the documentation is ahead of the beta release ...
(26 Feb '13, 05:07)
Reimer Pods
Replies hidden
Reimer: Note that the traceback() and error_*() functions only provide useful information if used within an exception (or catch) block. Once the stack has unwound the information is no longer available.
(26 Feb '13, 09:11)
Mark Culp
|