Issue using Dapper with C# to call an Oracle stored proc with refcursor as out parameter, however refcursor as return value works
If you do not want to use a strong type for your result using dapper (i.e: Query<YourStrongType>
), you can use Query<dynamic>
, the code below should work:
IEnumerable<dynamic> results = null; using (var conn = new OracleConnection(ConfigurationManager.ConnectionStrings["DataConnection"].ConnectionString)){ var p = new OracleDynamicParameters(); p.Add("outp ", dbType: OracleDbType.RefCursor, direction: ParameterDirection.Output); results = conn.Query<dynamic>("TESTPKG.TestingRefCursorsAsOutParam", p, commandType: CommandType.StoredProcedure); foreach (var row in results) { var fields = row as IDictionary<string, object>; }}