I faced a lot of problem while figuring out how to execute a stored procedure in Laravel4.
Here’s a simple way to do it :
$res = DB::select(‘call stored_proc_name(“‘.DB::raw($param1).‘”,”‘.DB::raw($param2).‘”)’);
I faced a lot of problem while figuring out how to execute a stored procedure in Laravel4.
Here’s a simple way to do it :
$res = DB::select(‘call stored_proc_name(“‘.DB::raw($param1).‘”,”‘.DB::raw($param2).‘”)’);
It’s cleaner like that :
$res = DB::select(‘call stored_proc_name(?,?)’, array($param1, $param2));
LikeLike
Yeah ! Thats certainly a cleaner way to do that. Thanks 🙂
LikeLike