Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Test a procedure which returns a sys_refcursor

485251Feb 25 2010 — edited Mar 2 2010
Hi all,

Oracle 9i

Got a simple stand alone procedure which has an input param and an output param, the second of which
is a ref cursor.

Can anyone tell me how I can go about testing this from within Pl/SQL (Command line)?


CREATE OR REPLACE PROCEDURE "LOGMNR"."LM"
(p_filename in varchar2, p_recordset OUT SYS_REFCURSOR)
as
begin

begin
dbms_output.put_line('Hello World');

OPEN p_recordset FOR
SELECT *
FROM test_table;

end;
end LM;

Also, and I know this is a huge long-shot. I'm going to be calling this procedure from VB6 (yes I know!), via ADODB, but I'm not
sure what type to add for the second parameter. Anyone called an Oracle procedure with ADODB which returns a refcursor/result set?

cmd.Parameters.Append cmd.CreateParameter("p_filename", adVarChar, adParamInput, 255, "c:\test.dat")
cmd.Parameters.Append cmd.CreateParameter("p_recordset", *???*, adParamOutput, 6000, "")


Regards
Dave
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 30 2010
Added on Feb 25 2010
12 comments
2,588 views