By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,110 Members | 1,535 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,110 IT Pros & Developers. It's quick & easy.

Oracle Stored Procedures with Enterprise Library June 2005 Version

P: n/a
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("AGENCYSELECTA LL");

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.ParameterNam e, prms.DbType,
prms.Size);
return
(AgencyEntityCollection)this.ExecuteSPMultiple(typ eof(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

Nov 3 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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

"ssp" <sa****@gmail.comwrote in message
news:11**********************@m7g2000cwm.googlegro ups.com...
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("AGENCYSELECTA LL");

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.ParameterNam e, prms.DbType,
prms.Size);
return
(AgencyEntityCollection)this.ExecuteSPMultiple(typ eof(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

Nov 3 '06 #2

P: n/a
ssp
The oracle stored procedure works fine. I am still experimenting with
trying to read results into my form.

chanmm wrote:
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

"ssp" <sa****@gmail.comwrote in message
news:11**********************@m7g2000cwm.googlegro ups.com...
Hello there,
Nov 5 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.