cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to view values in local temporary table in a procedure in debug mode

Former Member
1,964

Dear Experts,

While debugging a procedure, I am not able to view the data of a local temporary table. Kindly suggest a way to view the same. I can't even see the name of the temporary table in the parameter list.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member

You can use the "Debug" menu item "Query Database" to execute queries against that temporary table when you hit a breakpoint inside that stored procedure.

The advantage with that feature is the query will execute in the connection context of the one executing the procedure so temporary objects will have the values present at that time and point of the breakpoint. Some limitations do exist but that is your main feature for this kind of thing.

The disadvantages of using the Query Database menu includes needing to pop in and out of that menu every time you need to do that (not a biggie if you only need to do this once), pasting/typing in the query every time and it is not something that can be 'docked' like locals or watches.

To get something to work as a watch, you can create [a] non-deterministic function(s) that queries the temporary table for single values/aggregates as required and then craft an expression from that adding that expression to your watches. {My quick test did not produce a usable expression just querying the temp-table directly; so the function approach may be a minimum requirement for this.}

I'm sure one can get even more creative here. For instance, your function can take a column_name parameter and then query an aggregation (maybe even a select-list) on that column using execute immediate, so that one function can do many different jobs.