1

I have a trouble, when to execute procedure SQL Server on laravel.

The error

SQLSTATE[IMSSP]: The active result for the query contains no fields. (SQL: EXEC pr_stop 14)

And my sript

    public function stopLine(Request $request){

    $stop = Engine::where([['code', $request->engine]])
                          ->first();

      $quest = [$stop->id];

      DB::connection('mssql')->select('EXEC pr_stop ?', $quest);

    return $this->sendResponse($stop, 'Data successfully');
  }

How to fix them, because i stuck on this on using array / string data to parameter

11
  • It's not db::connection-> select, but you have to do something else. Try something like query first, but also check PDO's documentation. DB:: is basically PDO. Before you do, also check that Stored Procedure itself, because of the error message Commented Nov 30, 2023 at 3:01
  • 1
    What's the proc do? Commented Nov 30, 2023 at 3:01
  • To stop automation counting data input @Xedni Commented Nov 30, 2023 at 3:03
  • 2
    Does the proc return results? The error makes me think it's expecting a result set and the proc isn't returning one Commented Nov 30, 2023 at 3:08
  • 1
    Is the stored proc doing any DELETE, INSERT or UPDATE operations before it gets around to doing the SELECT? These operations will be generating rowcount events that could be tripping up Laravel, so try using SET NOCOUNT ON; at the top of the stored proc's code. Commented Nov 30, 2023 at 4:06

0

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.