how to execute stored Procedure with cursor with in pl/sql [message #502184] |
Tue, 05 April 2011 03:06 |
|
viperz
Messages: 2 Registered: April 2011
|
Junior Member |
|
|
hi all.
im kinda new to oracle pl/sql
i'v been trying to do this simple thing for a while now, with no luck (and searched all over the net...)
to keep things simple:
lets say that this is my procedure:
create or replace procedure testSp(x out sys_refcursor )
is
begin
open x for
select 1 from dual;
end;
how would i be able to execute this from with in sqlTools to see the result ??? i have tried everything...
my goal is in the end to execute this from Magic 8 (to those who herd of it)
p.s this needs to work in oracle 8
thanks for any help
[Updated on: Tue, 05 April 2011 03:08] Report message to a moderator
|
|
|
|
|
|
Re: how to execute stored Procedure with cursor with in pl/sql [message #502197 is a reply to message #502192] |
Tue, 05 April 2011 03:36 |
|
Michel Cadot
Messages: 68728 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version, with 4 decimals.
SQL> create or replace procedure testSp(x out sys_refcursor )
2 is
3 begin
4 open x for
5 select 1 from dual;
6 end;
7
8 /
Procedure created.
SQL> var x refcursor
SQL> exec testSp (:x)
PL/SQL procedure successfully completed.
SQL> print x
1
----------
1
1 row selected.
Regards
Michel
|
|
|