Simon Davies
Simon Davies

Reputation: 3686

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

Upvotes: 4

Views: 13171

Answers (2)

MichaelShimniok
MichaelShimniok

Reputation: 71

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

Upvotes: 1

ihebiheb
ihebiheb

Reputation: 5203

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 :)

Upvotes: 8

Related Questions