Groups | Blog | Home
all groups > dotnet ado.net > july 2007 >

dotnet ado.net : EnterpriseLibrary. Return Recordset from oracle stored procedure


Oleg
7/13/2007 1:12:04 PM
Hi,
I'm trying to use an EnterpriseLibrary 3.1 and return recordset from oracle
database using stored procedure.
As you may know, oracle stored procedures have out parameter of type cursor
in order to return a dataset.

It seems like I need to add a paramenter of type cursor to execute this
stored procedure, but I can't find the type for the cursor.

Does enterprise Library support this senario at all?

Thanks everybody,
Oleg
Matt Noonan
7/15/2007 7:27:40 PM
[quoted text, click to view]

Yes, it is supported, but you don't have to add it. The Data block adds the
cursor for you when you call ExecuteDataSet. The only thing you have to do
is declare a "cur_out" (the default name) as the first parameter in your
stored procedure.

--
Matt Noonan
EasyObjects.NET: The O/RM for the Enterprise Library
http://www.easyobjects.net

Oleg
7/17/2007 11:42:01 AM
Thank you Matt.

I also found this information. Now I use a little of custom code to use any
name in cursor.
The idea is to create a cursor parameter yourself, then the Library will see
it and won't add default one:(cursor name is 'p_cur' in SP in subject)

<code>
db.AddOutParameter(dbCommand, "p_cur",DbType.Object, 8);
((OracleParameter)dbCommand.Parameters["p_cur"]).OracleType =
OracleType.Cursor;
</code>



[quoted text, click to view]
AddThis Social Bookmark Button