cancel
Showing results for 
Search instead for 
Did you mean: 

Procedure Execution Debugging

JimDiaz
Participant
1,308

SQL Anywhere 17.0.10.6160

I'm interested in recording the execution of procedures and functions while debugging. If possible I would also like to record the parameter values sent to the procedure or function. Is there an automated method for doing this?

Thanks Jim

chris_keating
Product and Topic Expert
Product and Topic Expert
0 Kudos

Not in the debugger but perhaps the request logging level procedures+hostvars could be used for this? See RequestLogging/RequestLogFile set using sa_server_option (or via the -zr/-zo command line settings). The request log can be analyzed using sa_get_request_times which creates the temporary tables SATMP_request_time and SATMP_request_hostvar.

VolkerBarth
Contributor
0 Kudos

I'm interested in recording the execution of procedures and functions while debugging.

What exactly do you want to get recorded (besides the parameter values, as stated in the second question)?

FWIW, you can use MESSAGE statements with the DEBUG ONLY clause and then decide via the debug_messages option whether those MESSAGE statements are executed or not. (Note, it apparently is independent of running the SQL Debugger or not.) And you might use the buitin sa_strack_trace() or STACK_TRACE() to get information about caller hierarchies and/or parameter values. – Obviously, this requires modifications to procedures and functions beforehand.

JimDiaz
Participant
0 Kudos

Thanks. I was hoping to use the sa_stack_trace or STACK_TRACE to return Owner.ProcedureName as well as the passed in parameter values. The plan was to call an internal debug procedure with the returned value(s) which would store in a table with whatever else was needed. In this way the same line of code could be added to each procedure to store the debug information.

Accepted Solutions (0)

Answers (0)