3

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?

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.