EnterpriseLibrary. Return Recordset from oracle stored procedure

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
Oleg said:
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?

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.
 
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>
 
Back
Top