Reputation: 875
I am running a stored procedure from my form on submit. However, I keep getting the following error:
The active result for the query contains no fields.
Below is what I have tried.
Code to execute SP
DB::select('EXEC myStored_Procedure');
I have also tried
DB::select('SET NOCOUNT ON; EXEC myStored_Procedure');
But both return the same error. I have also used Set NOCOUNT ON;
within the stored procedure itself, but with the error still occurs.
My SP works fine and my web page works fine separately, but when I call the SP from the web page it always returns this error.
How can I get around this error?
Upvotes: 2
Views: 3261
Reputation: 32785
DB::select
expects some data to be returned as a response to the query that was sent to db. You can use DB::statement
instead, if you don't care about the results sent from db, or if the db doesn't send any:
DB::statement('EXEC myStored_Procedure');
Upvotes: 6