problem when trying to debug with pl/sql debugger

allensd

Member
Trying to setup a debug session with pl/sql debugger and I'm having some trouble.

First, I bring up the test window, then I put a simple select * from mytable; statement in after the begin statement so that my code looks like this

declare
i integer;
begin
SELECT * FROM mytable;
end;

Then I try to toggle breakpoint on the select line and it wont do it. Next I hit 'start' from the debug drop down, then I hit 'run' which appears to cause nothing to happen (I should see some output from the select statement at the very least). Then I click through the tabs to 'profiler' which then hangs the debugger entirely. Looking on the server it appears hung on a pipeget while executing a debugend statement.

what am I doing wrong?

btw, this is on pl/sql developer 9.
 
This is not a valid PL/SQL code. You can run queries from the test window, but then you should have only
Code:
SELECT * FROM mytable;

If you need to debug a block you should have something like
Code:
declare
i integer;
begin
SELECT mycolumn into i FROM mytable;
end;

I'm not sure Oracle API allows breakpoints in an anonymous block, though.

Regards,
Gustavo
 
great information Gustavo. I am not that familiar with pl/sql so I will fix things up that way to get it started.

having said that, what would I need to do, to make this not an 'anonymous block'?
 
You could save the code to the database and then test this program. Enter this in a Program Window:
Code:
create or replace procedure myprogram_p is
i integer;
begin
SELECT mycolumn into i FROM mytable;
end;

Compile the program and then enter this in a Test Window:
Code:
begin
myprogram_p;
end;

Right-click myprogram_p, choose "Add Debug Information" and you're ready to debug.

HTH

Regards,
Gustavo
 
Back
Top