Problems with Stored Procedures on Laravel 5.6?

Asked

Viewed 85 times

0

I’m making a select in a procedure, but I can’t page because the result returns array:

DB::select('EXEC PR_MONITORAMENTO @FUNCAO="S2", @ID_CD_INTERNACAO='.$ID_INTERNACAO.', 
     @ID_CD_CONVENIO='.$ID_CONVENIO.',@NM_PESSOA= '.$NM_PESSOA.'');

And when I do a db::raw it returns an object with the name

DB::raw('EXEC PR_MONITORAMENTO @FUNCAO="S2", @ID_CD_INTERNACAO='.$ID_INTERNACAO.', 
     @ID_CD_CONVENIO='.$ID_CONVENIO.',@NM_PESSOA= '.$NM_PESSOA.'');

object(Illuminate\Database\Query\Expression)#290 (1) 
{ 
    ["value":protected]=> string(95) 
    "EXEC PR_MONITORAMENTO @FUNCAO="S2", @ID_CD_INTERNACAO=, 
        @ID_CD_CONVENIO=,@NM_PESSOA= " 
}

I want to do the select in that procedure and page, any hint?

  • You have to page your Stored Procedure and with DB::select it’s not really going to work out, because your logic is in Stored Procedure. Now if it were a Vision (View) you could do what you need!

  • In case I would have to do that select from stored Process within the view right? but that would escape from the good practices? I thank you from already

  • In case you should only do the View !!!

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.