Print Thread
Using debug session to manually get variable values
#64490 03/08/23 03:54 PM
Joined: Nov 2022
Posts: 5
M
Member
OP Offline
Member
M
Joined: Nov 2022
Posts: 5
After I start a debug session, I want to execute sql in debug session in order to obtain value by hand.
Is that possible?

I was using this, which ends up in error (xec is always 28).
SQL Query
declare
  xec  binary_integer;
  buff  varchar2(2000);
begin
  xec := dbms_debug.get_value('varname', 0, buff);

end;

Is there something wrong in this picture?
Tnx

Re: Using debug session to manually get variable values
mpapec2010 #64492 03/09/23 09:23 AM
Joined: Aug 1999
Posts: 22,220
Member
Offline
Member
Joined: Aug 1999
Posts: 22,220
This is indeed not possible. The dbms_debug.get_value function can only be called from the controlling session, to which you do not have access. You can only obtain variable values through the normal PL/SQL Developer debugger functions. You can also execute SQL code within the debug session when execution is paused through the "Execute SQL in debug session" button on the debugger toolbar.


Marco Kalter
Allround Automations
Re: Using debug session to manually get variable values
Marco Kalter #64499 03/10/23 07:33 AM
Joined: Nov 2022
Posts: 5
M
Member
OP Offline
Member
M
Joined: Nov 2022
Posts: 5
Originally Posted by Marco Kalter
You can also execute SQL code within the debug session when execution is paused through the "Execute SQL in debug session" button on the debugger toolbar.

So "executing in debug session" executes a query in target, rather than debug session?

Re: Using debug session to manually get variable values
mpapec2010 #64501 03/10/23 09:27 AM
Joined: Aug 1999
Posts: 22,220
Member
Offline
Member
Joined: Aug 1999
Posts: 22,220
It executes a SQL command or PL/SQL Block in the session that runs the program that you are debugging.


Marco Kalter
Allround Automations
Re: Using debug session to manually get variable values
Marco Kalter #64502 03/10/23 12:03 PM
Joined: Nov 2022
Posts: 5
M
Member
OP Offline
Member
M
Joined: Nov 2022
Posts: 5
Originally Posted by Marco Kalter
It executes a SQL command or PL/SQL Block in the session that runs the program that you are debugging.

Oh, I see; Oracle docs use a bit different terminology.

Quote
To debug server-side code, you must have two database sessions: one session to run the code in debug mode (the target session), and a second session to supervise the target session (the debug session).
https://docs.oracle.com/database/121/ARPLS/d_debug.htm#ARPLS66093


Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.100s Queries: 14 (0.056s) Memory: 2.5174 MB (Peak: 3.0427 MB) Data Comp: Off Server Time: 2024-05-17 11:27:14 UTC
Valid HTML 5 and Valid CSS