Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What OracleType to use for table of record output parameter

Status
Not open for further replies.

whiteadi

Programmer
Apr 8, 2003
11
NL
Hi,

there is a stored procedure in Oracle that has a output parameter of type table of records.

What OracleType to use in C# to retrieve it?

Regards,
Adrian
 
ADO.Net parameters are scalar meaning a single value, date, int, string, bit, blog, etc. you cannot output a results set (array, table) to a parameter. as a work around you could have a sql statement execute the proc and select the results of the output. it would look something like this... (i have not exposure to oracle, so the syntax could be way off, but you'll get the idea).
Code:
var records = new DataTable();
using(var command = connection.CreateCommand())
{
   command.CommandText = @"declare @table as tableresult
exec stored_proc output @table
select * from @table";
   record.Load(command.ExecuteReader());
}
return records;

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top