Calling Stored Procedure using REF CURSORS







Hi, I'm calling an external Stored Procedure written in PL/SQL that
includes one input argument and an output argument that is a REF CURSOR.
When I run the code I get the error's indicated below. Any ideas on what
needs to be changed?

Package Information:

p1-Procedures input argument (VARCHAR)
out_cursor-REF Cursor as an output argument

My Code:

my $IN_FILE_NM = "TEST";
my $out_cursor;
my $func = $dbh->prepare("BEGIN :out_cursor :=
PackageName.ProcedureName(:p1,:out_cursor); END;");
$func->bind_param(":p1",$IN_FILE_NM);
$func->bind_param_inout(":out_cursor", \$out_cursor, 0,{ ora_type=>ORA_RSET
} );
$func->execute;

Error I'm Getting

1. wrong number or types of arguments in call
2. Statement ignored (DBD ERROR: error possibly near <*> indicator

DBD::Oracle::st execute failed: ORA-06550: line 1, column 22:
PLS-00306: wrong number or types of arguments in call to 'PROCEDURE'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored (DBD ERROR: error possibly near <*> indicator at
char 21 in 'BEG
IN :out_cursor := <*>Package.Procedure(:p1,:out_cursor);
END;') [for Statement "BEGIN :out_cursor := Package.Pr_Get_Config_Syste
m_Path(:p1,:out_cursor); END;" with ParamValues:
:out_cursor=DBI::st=HASH(0x20039fec), :p1
='TEST'] at reload_historical_data.pl line 64.

We are Using:

Oracle 9
Perl - 5.8.0
DBD -1.16


.



Relevant Pages

  • Re: Too Many Cursors?
    ... owning that ref cursor pointer terminates, or when the ref cursor is explicitly closed (e.g. using the PL/SQL call CLOSE). ... The client calls an API and it hands ... This can be a %ROWTYPE data type, a PL/SQL user defined struct ...
    (comp.databases.oracle.misc)
  • Syntax of setting Ref Cursor in procedure from JDBC
    ... I am calling a SP from java. ... IN String variables ... IN OUT variable which is a REF CURSOR ... Is the calling syntax correct of the SP with these 3 parameters? ...
    (comp.lang.java.databases)