0

I've to use an oracle function that returns an array of strings in a c# webapi. I don't realy have an idea on how to do this. I've started with the following code:

using (var cmd = _connection.CreateCommand()) 
{
    cmd.CommandType = CommandType.Text;
    //dual is temporary table where data is stored?!
    cmd.CommandText = "select Test_mp.f_loten(:p_item)  from dual";
    var p = cmd.Parameters;
    p.Add("p_item", 12942);
    _connection.Open();
    var rd= await cmd.ExecuteReaderAsync();
}
Mahdi
  • 3,199
  • 2
  • 25
  • 35
Timvr01
  • 476
  • 4
  • 15
  • http://stackoverflow.com/questions/3961908/select-from-plsql-associative-array – Dmitry Bychenko Dec 12 '16 at 08:15
  • An example with an array as an input parameter: http://stackoverflow.com/questions/29605713/calling-an-oracle-procedure-with-a-pl-sql-collection-type-parameter-via-net – MT0 Dec 12 '16 at 09:57
  • Oracle's documentation for passing arrays using C# ODP.NET http://www.oracle.com/technetwork/issue-archive/2007/07-jan/o17odp-093600.html – MT0 Dec 12 '16 at 09:59

1 Answers1

0

The problem was my return type which was a custom Oracle type.

Timvr01
  • 476
  • 4
  • 15