How to execute Stored Procedure from Laravel?

0 votes
I need to execute a stored procedure after my form submits data. I have the stored procedure working like I want it, and I have my form working properly. I just do not know the statement to execute the sp from laravel 5.

it should be something like this: execute my_stored_procedure. but I can not seem to find anything like that online.
Apr 3 in Laravel by kartik
• 10,990 points
185 views

1 answer to this question.

0 votes

Hello @kartik,

You can try something like this

DB::select('exec my_stored_procedure("Param1", "param2",..)');

or

DB::select('exec my_stored_procedure(?,?,..)',array($Param1,$param2));

Try this for without parameters

DB::select('EXEC my_stored_procedure')

Hope this is helpful!!

Thank You!!

answered Apr 3 by Niroj
• 22,110 points

Related Questions In Laravel

0 votes
1 answer

How to change Laravel official name to any customize name?

Hey, You just need to go Laravel folder through ...READ MORE

answered Mar 17 in Laravel by Niroj
• 22,110 points
32 views
0 votes
1 answer

How to make a new page with routing using Laravel?

Hey @kartik, First you have to go to ...READ MORE

answered Mar 18 in Laravel by Niroj
• 22,110 points
71 views
0 votes
1 answer

How to make anchor tag with routing using Laravel?

Hey @kartik, First you have to go to ...READ MORE

answered Mar 18 in Laravel by Niroj
• 22,110 points
417 views
0 votes
1 answer

How to pass URL param in Laravel?

Hello, First you have to go to routes ...READ MORE

answered Mar 18 in Laravel by Niroj
• 22,110 points
101 views
0 votes
1 answer

What is meant by passing the variable by value and reference in PHP?

Hello, When the variable is passed as value ...READ MORE

answered Mar 27 in PHP by Niroj
• 22,110 points
36 views
0 votes
1 answer

Connection with MySQL server using PHP. How can we do that?

Hey @kartik, You have to provide MySQL hostname, ...READ MORE

answered Mar 27 in PHP by Niroj
• 22,110 points
40 views
0 votes
1 answer

How to retrieve or obtain data from the MySQL database using PHP?

Hello kartik,  Actually there are many functions that  ...READ MORE

answered Mar 27 in PHP by Niroj
• 22,110 points
33 views
0 votes
1 answer

What are the differences between mysqli_connect and mysqli_pconnect?

Hello, mysqli_pconnect() function is used for making a persistence ...READ MORE

answered Mar 27 in PHP by Niroj
• 22,110 points
69 views
0 votes
1 answer

How to use Stored Procedures in Laravel?

Hey, To create a Stored Procedure you can ...READ MORE

answered Mar 24 in Laravel by Niroj
• 22,110 points
134 views
0 votes
1 answer

How to get data from Laravel backend and display in Vue/Nuxt frontend

Hello, You have to use the package dotenv. Then ...READ MORE

answered Apr 8 in Laravel by Niroj
• 22,110 points
73 views