Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating Stored procedure within MySQL Workbench

Does anyone know how I can create a stored procedure within mysql workbench? I would like to get to know and use them but how do I store the one(s) I create so that I can then call them? In workbench or within my php code would be better.

update thought I might share this link as it might come in handy to anyone viewing this

Stored Procedures in MySQL and PHP how to article

like image 521
Simon Davies Avatar asked Feb 20 '23 10:02

Simon Davies


2 Answers

to add a stored procedure in Mysql workbench:

1) Click the triangle in the left of your database: you should see tables, views, and routines

2) Right click on routines -> Create procedure

You're done :)

like image 56
ihebiheb Avatar answered Feb 23 '23 00:02

ihebiheb


Within the EER diagram:

  • Click the Place a New Routine Group toolbar icon, and
  • Place the routine group.
  • Double click the resulting rectangle to edit it.
  • Go to the Group: Routines tab and
  • Click the bottom Routine Group tab to edit the group or
  • Click the bottom Routines tab to edit the actual routines.

Alternatively, from the Model diagram, click the Add Group icon under Routine Groups heading then click the Add Routine under the Routines heading.

Source: dev.mysql.com

like image 36
MichaelShimniok Avatar answered Feb 22 '23 23:02

MichaelShimniok