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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With