Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

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

asked 09 May '23, 12:19

J%20Diaz's gravatar image

J Diaz
1.2k404968
accept rate: 10%

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.

(10 May '23, 10:04) Chris Keating

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.

(10 May '23, 11:14) Volker Barth

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.

(01 Jun '23, 17:12) J Diaz
Be the first one to answer this question!
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:

×106

question asked: 09 May '23, 12:19

question was seen: 1,149 times

last updated: 01 Jun '23, 17:12