2

I would like to call a PL/SQL function that returns a SYS_REFCURSOR.

One of the ways I have tried looks like this:

var userIdParameter = DataParameter.Decimal("userId", user.Id);
var returnValue = new DataParameter { Direction = ParameterDirection.ReturnValue };
var result = dataConnection.ExecuteProc("SECURITY.GetUserRoles", userIdParameter, returnValue);

This produces the following error:

PLS-00382: expression is of wrong type

Are functions returning a SYS_REFCURSOR supported by Linq2DB?

CodeFox
  • 3,321
  • 1
  • 29
  • 41

1 Answers1

2

Support for such parameters was added in Linq2DB 1.8. You need to add DataType = DataType.Cursor to return parameter.

See example in linq2db tests: https://github.com/linq2db/linq2db/blob/master/Tests/Linq/DataProvider/OracleTests.cs#L1881