I have one sp for inserting the data, it has three params, Ex: a,b,c. so I want to run the sp with params, but not able to find the solution in laravel.
This is what i tried.
DB::select('EXEC sp_name @a=a, @b=b, @c=c');
But, its not working.
I have one sp for inserting the data, it has three params, Ex: a,b,c. so I want to run the sp with params, but not able to find the solution in laravel.
This is what i tried.
DB::select('EXEC sp_name @a=a, @b=b, @c=c');
But, its not working.
I have got the answer. only quote was missing
This is the working example
DB::select("EXEC sp_name @a='a', @b='b', @c='c'");
Try this:
$a=1;
$b=2;
$c=3;
$data=DB::select('call sp_name(?,?,?)',[$a,$b,$c]);