How to get a value of a custom sql srv variable or a result set when calling procedure in Laravel? #37258
Unanswered
sasokovacic
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, how can an SQL variable be declared to be used in a procedure statement and then its value be returned to PHP? If I declare it in a separate query before the execution of a procedure, I get the following error:
SQLSTATE[HY000]: General error: 20018 Must declare the table variable "@Id".
When I use the DB::unprepared() method to execute all queries in the same statement, the above error goes away, but I don't get a result back. I need to get the @ReturnError and @id so I can use them in my PHP code.
This is the procedure call
Beta Was this translation helpful? Give feedback.
All reactions