You can add Routine Groups to a database either from the Physical Schemata section of the MySQL Model page or from an EER Diagram. Routines may only be added from the Physical Schemata section of the MySQL Model page.
To view an existing schema, along with its Routines and Routine Groups, select Physical Schemata panel on the MySQL Model page. The Routines and Routine Groups are listed there.
, from the main menu. After the schema has been added to the current model, you can see the schema objects on theMySQL Workbench unifies both stored procedures and stored functions into one logical object called a Routine. Routine Groups are used to group routines that are related. You can decide how many Routine Groups you want to create and you can use the Routine Group Editor to assign specific routines to a group, using a drag and drop interface.
When designing an EER Diagram you can place the Routine Groups on the canvas by dragging them from the Catalog Palette. Placing individual routines on the diagram is not permitted, as it would clutter the canvas.
Double-clicking the Add Routine
icon in the
Physical Schemata
section of the
MySQL Model
page adds a routine with the
default name of routine1
. If a routine with
this name already exists, the new routine is named
routine2
.
Adding a new routine automatically opens the routine editor docked at the bottom of the application. Using the routine editor is described in Section 16.6.7.4.1.2, “The Routine Editor”.
Right-clicking a routine opens a pop-up menu with the following options:
The
option opens the routine editor.The cut and paste options are useful for copying routines between different schemata.
Deleting the code for routine from the Routines tab of the Routine Group Editor will result in removal of the routine object from the model.
To remove a routine from a routine group use the controls on the Routine Group tab of the Routine Group Editor.
The action of the delete option varies depending upon the way you have configured MySQL Workbench. For more information, see Section 16.4.4.4, “The Model Tab”.
You can invoke the routine editor by double-clicking a routine
in the Physical Schemata
section on the
MySQL Model
page. Doing this opens the
routine editor docked at the bottom of the application. Any
number of routines may be open at the same time. Each additional
routine appears as a tab at the top of the routine editor.
There are two tabs at the bottom of the routine editor, the Routine and the Privileges tabs. Navigate between different tabs using the mouse or from the keyboard by pressing Ctrl + Alt + Tab.
From the Routine
tab of the routine editor
you can perform the following tasks:
Rename the routine using the Name text box.
Enter the SQL to create a routine using the SQL text area.
The Privileges
tab of the routine editor
functions in exactly the same way as the
Privileges
tab of the table editor. For
more information, see
Section 16.6.7.1.3.10, “The Privileges Tab”.
Privileges are only available in the Standard Edition of MySQL Workbench.
Double-clicking the Add Routine Group
icon in
the Physical Schemata
section of the
MySQL Model
page adds a routine with the
default name of routines1
. If a routine group
with this name already exists, the new routine group is named
routines2
.
Adding a new routine group automatically opens the routine groups editor docked at the bottom of the application. Using the routine groups editor is described in Section 16.6.7.4.2.3, “The Routine Group Editor”.
Right-clicking a routine group opens a pop-up menu with the following options:
The Section 16.6.7.4.2.3, “The Routine Group Editor”.
option opens the routine group editor. Using the routine group editor is described inThe cut and paste options are useful for copying routine groups between different schemata.
Deleting a routine group from the MySQL Model
page removes the group but does not remove any routines
contained in that group.
Any routine groups added to the Physical
Schemata
also show up in the
Catalog
palette on the right side of the
application. They may be added to an EER Digram by dragging and
dropping them from this palette.
Routine groups can also be added to an EER Diagram using the
Routine Groups
tool on the vertical toolbar.
To do this make sure that the EER Diagram
tab
is selected, and right-click the routine groups icon on the
vertical toolbar. The routine groups icon is immediately above
the lowest toolbar separator.
Clicking the mouse on this icon changes the mouse pointer to a routine group pointer. You can also change the mouse pointer to a routine pointer by pressing the G key.
Choosing the Routine Group
tool changes the
contents of the toolbar that appears immediately below the menu
bar. When the Routine Groups
pointer is
active, this toolbar contains a drop down list box of schemata
and a drop down color chart. Use these list boxes to select the
appropriate schema and color accent for the new routine group.
Make sure that you associate the new routine group with a
database. The color of your routine group can easily be changed
later using the Properties
palette.
Create a routine group by clicking anywhere on the EER Diagram
canvas. This creates a new routine group with the default name
routines1
. To revert to the default mouse
pointer, click the arrow icon at the top of the vertical
toolbar.
Right-clicking a routine group opens a pop-up menu. With the exception of the delete option and rename options these menu options function as described in Section 16.6.7.4.2.1, “Adding Routine Groups to the Physical Schemata”. There is no rename option and the behavior of the delete option is determined by your MySQL Workbench options settings. For more information, see Section 16.4.4.4, “The Model Tab”.
You can invoke the routine group editor by double-clicking a
routine group object on the EER Diagram canvas or by double
clicking a routine group in the Physical
Schemata
section on the MySQL Model
page. Doing this opens the routine group editor docked at the
bottom of the application. Double-clicking the title bar undocks
the editor. Do the same to redock it. Any number of routine
groups may be open at the same time. Each additional routine
group appears as a tab at the top of the routine editor,
There are two tabs at the bottom of the routine editor, the Routine group and the Privileges tabs. Navigate between different tabs using the mouse or from the keyboard by pressing Ctrl + Alt + Tab.
From the Routine Groups
tab of the routine
groups editor you can perform the following tasks:
Rename the routine group using the Name text box.
Add routines to the group by dragging and dropping them.
Add comments to the routine group.
The Privileges
tab of the routine group
editor functions in exactly the same way as the
Privileges
tab of the table editor. For
more information, see
Section 16.6.7.1.3.10, “The Privileges Tab”.
Privileges are only available in the Standard Edition of MySQL Workbench.
When you select a routine group on the EER Diagram canvas, its
properties are displayed in the Properties
palette. All of the properties accessible from the
Properties
palette apply to the appearance
of a routine group on the EER Diagram canvas.
For a list of the properties accessible through the
Properties
palette see
Section 16.6.5.11, “The Properties Palette”.