Oracle Stored Procedures with Enterprise Library June 2005 Version

S

ssp

Hello there,

I am trying to do very simple thing in trying to return results from an
Oracle (10g) Stored Procedure using the Enterprise Library June 2005
Version.

The stored procedure first:
============================================
CREATE OR REPLACE PROCEDURE AGENCYSELECTALL(p_cursor OUT
SelectPackage.SelectCursor)
as
begin
open p_cursor for select * from sa.agency;
end AGENCYSELECTALL;
/
============================================

The cursor is defined in a package called SelectPackage as
===========================================
CREATE OR REPLACE PACKAGE SelectPackage AS

TYPE SelectCursor IS REF CURSOR;

END SelectPackage;
/
============================================

The code for executing the stored procedure looks a like this:
============================================
public AgencyEntityCollection SelectAll()
{
DBCommandWrapper dbCommandWrapper =
this.Db.GetStoredProcCommandWrapper("AGENCYSELECTALL");

OracleParameter prms = new OracleParameter();

prms = new OracleParameter("P_CURSOR", OracleType.Cursor, 30000,
ParameterDirection.Output, Convert.ToBoolean(1), 0, 0, "",
DataRowVersion.Default, null);

dbCommandWrapper.AddOutParameter(prms.ParameterName, prms.DbType,
prms.Size);
return
(AgencyEntityCollection)this.ExecuteSPMultiple(typeof(AgencyEntityCollection),
typeof(AgencyEntity), dbCommandWrapper);
}
============================================

Now, everytime I run this, I get the error:
============================================
Message: ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to
'AGENCYSELECTALL'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
============================================

Could anyone shed some light, as to what I maybe doing wrong?

Thanks
 
C

chanmm

Try to stick to ANSI SQL than PL/SQL for your Oracle is safe. Make sure you
do not have 2 version of Oracle in your machine.

chanmm
 
S

ssp

The oracle stored procedure works fine. I am still experimenting with
trying to read results into my form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top