Procedure stored in laravel with parameter

5

I have seen two syntaxes when calling stored procedures that receive parameters in laravel, both work perfectly:

//Concatenando parametro    
DB::select('exec Miprocedimiento "'.$parametro.'"');

//Utilizando ?
DB::select('exec Miprocedimiento ?', array($parametro));

What is the correct way? Is there a difference in terms of performance, safety?

    
asked by Francisco Quijada 11.04.2018 в 17:17
source

0 answers