One of the items listed as a feature in the Introduction to the SQL Anywhere debugger is the following:

"Execute queries You can execute queries when execution is stopped at a breakpoint in a SQL procedure. This permits you to look at intermediate results held in temporary tables, check values in base tables, and to view the query execution plan."

I don't see any explanation anywhere of how to do that. Can anyone provide some insight into this?

asked 29 Sep '16, 17:34

timoccci's gravatar image

timoccci
86179
accept rate: 0%


You can run queries from the Debug menu using the "Query Database" pick; when you are in the debugger after hitting a breakpoint.

I do remember seeing the graphical plan part of this demonstrated once but will have to research it more. It may have involved running a query using the graphical_plan function (possibly embedded in the procedure) ...

permanent link

answered 30 Sep '16, 10:19

Nick%20Elson%20SAP%20SQL%20Anywhere's gravatar image

Nick Elson S...
7.3k35107
accept rate: 31%

edited 01 Nov '16, 16:46

These two articles were written from actual experience capturing plans inside large, complex stored procedures:

Capture Plans With GRAPHICAL_PLAN()

Capturing and Storing Plans With GRAPHICAL_PLAN()

permanent link

answered 30 Sep '16, 10:50

Breck%20Carter's gravatar image

Breck Carter
25.7k428592852
accept rate: 20%

Good point Breck. I was thinking there might have been a way to pop directly into a plan viewer but one would need to capture the plan first and then later use dbisql for that.

(30 Sep '16, 11:18) Nick Elson S...
Replies hidden

Well, the execution profiler could capture the graphical plan at a breakpoint if there was a feature to do that...

and apparently such a feature exists!...

Execute queries You can execute queries when execution is stopped at a breakpoint in a SQL procedure. This permits you to look at intermediate results held in temporary tables, check values in base tables, and to view the query execution plan.

(30 Sep '16, 15:25) Breck Carter

So we're back to the original question, right?

(01 Oct '16, 06:28) Volker Barth

Yes... one of us should go looking to see if it actually exists and is simply well-hidden :)

(01 Oct '16, 08:26) Breck Carter

I'm still researching this and if I find out anything different from the information below I will report back here ....

My current understanding is you can see the result set of any query in the debugger's Query Database utility. So you can execute a select plan( ...) or a select graphical_plan( ... ) and see the result set representation of that. The latter query is less useful because of some severe length restrictions.

So not the answer hoped for. Plan( ) or even a Sort_Plan( ) might fit into the length restrictions of the result set ... but no graphical plan viewer; at least not built into this utility.

As such that much does match the article referenced.

(01 Nov '16, 17:16) Nick Elson S...
Your answer
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:

×242
×4

question asked: 29 Sep '16, 17:34

question was seen: 208 times

last updated: 01 Nov '16, 18:02