EnterpriseLibrary. Return Recordset from oracle stored procedure

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
 
M

Matt Noonan

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.
 
G

Guest

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>
 

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