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 7.5.4.1.2, “The Routine Editor”.
Right clicking a routine opens a pop-up menu with the following options:
Rename
Cut
'routine_name
'
Copy
'routine_name
'
Edit Routine...
Edit in New Window
Copy SQL to Clipboard
Delete
'routine_name
'
The Edit Routine ... 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 5.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. Double
clicking the routine tab undocks the editor. Double click the
title bar to redock it. 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 View 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 7.5.1.3.10, “The Privileges Tab”.
Privileges are only available in the Standard Edition of MySQL Workbench.