Why doesn't this work in a PL/SQL Developer command window?

timboc

Member²
variable x REFCURSOR

begin
open :x for select distinct location_name from t_location;
end;
/

print x

-- works fine in SQL*Plus
 
Cursor variables are not supported in the Command Window. You may want to use the Test Window for this.
 
Can you show me the syntax I'd use to accomplish the same in a Test Window?

Also, is there are reason this isn't implemented in a Command Window?

Thanks,
Tim
 
In the Anonymous PL/SQL Block of the Test Window:

Code:
begin
  open :x for select distinct location_name from t_location;
end;
Declare the :x variable as "Cursor" in the bind variable list at the bottom of the window, run the script, and press the [...] button of the :x variable to get the result set.
 
This is great for comparing before and after states of your tables.

I save the max pk before and open a cursor for the before state, run the code with no commit, then after the run I open another with the after state. When all done comparing I rollback and I can run the same test again and again.
 
Thanks for the info. Can you elaborate on why this isn't implemented in a Command Window?

I'm both a PL/SQL Developer user and a Delphi Developer (using your Direct Oracle Access product, which is amazing). I was just wondering.
 
Back
Top