2

Please assist executing a dapper function below. I am using oracle Below query complains that its missing a FROM, but when from is added, it complains that the query is not properly created.

 var user = connection.Query<dynamic>("select myfunctionname(:Username, :Password)", new { Username = input.Username, Password = input.Password },commandType: CommandType.Text).First();
5
  • @Steve I get "Not all variables are bound" error Commented Jun 2, 2021 at 9:56
  • Note: there is a QueryFirst<T> method, and it is almost always preferable to avoid dynamic Commented Jun 2, 2021 at 9:56
  • Dapper doesn't modify the query, it sends it directly to the database for execution. Have you tried running that query by itself? If Oracle complains that FROM is missing, you probably need to add it Commented Jun 2, 2021 at 9:58
  • Not all variables are bound that's a completely different error from what you posted in the question. What is the actual error? Commented Jun 2, 2021 at 9:59
  • @PanagiotisKanavos the question asked was what happens when I remove CommandType.Text to StoredProcedure then I said I get an error "Not all variables are bound" Commented Jun 2, 2021 at 10:01

1 Answer 1

1

If Oracle functions work like SQL Server table-valued functions (UDFs), then you probably mean select * from myfunctionname(:Username, :Password)

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.