MySQL

The world's most popular open source database

Contact a MySQL Representative

Login | Register


  • MySQL.com
  • Developer Zone
  • Partners & Solutions
  • Customer Login
  • DevZone
  • Downloads
  • Documentation
  • Articles
  • Forums
  • Bugs
  • Forge
  • Blogs
 
  • Documentation Library
    • Table of Contents
Search manual:

Additional languages
  • Greek
  • Italian
  • Portuguese
  • Russian
  • Spanish


MySQL Query Browser :: 9 Using The MySQL Query Browser :: 9.9 Managing Stored Procedures and Functions with MySQL Query Browser
« 9.8 Comparing Result Sets

9.10 Editing Queries From a Development Tool »
Section Navigation      [Toggle]
  • 9 Using The MySQL Query Browser
  • 9.1 Entering and Editing Queries Manually
  • 9.2 Building Queries
  • 9.3 Creating Views
  • 9.4 Navigating Result Sets Within the Result Area
  • 9.5 Exporting Result Sets
  • 9.6 Handling BLOB and TEXT Columns
  • 9.7 Editing Result Sets Within the Result Area
  • 9.8 Comparing Result Sets
  • 9.9 Managing Stored Procedures and Functions with MySQL Query Browser
  • 9.10 Editing Queries From a Development Tool

9.9. Managing Stored Procedures and Functions with MySQL Query Browser

When used with MySQL version 5 and higher, the MySQL Query Browser supports creating, editing, and viewing stored procedures and functions.

Stored procedures and stored functions are displayed in the database browser with a special icon to distinguish them from regular tables and views. Click the arrow to the left of a stored procedure or stored function to display the parameter list for that procedure or function.

Figure 9.3. Stored procedure in database browser

Stored procedure in database
          browser

To edit a stored procedure or stored function, right-click on it in the database browser and choose the Edit Procedure or Edit Function option. This opens a new script editor tab with the selected procedure/function displayed. Once you have finished editing, click the Execute button above the script area or click the Execute option of the Script menu to update the procedure/function.

To create a new stored procedure or function, choose the Create Stored Procedure / Function option from the Script menu. Enter the desired procedure/function name and click either the Create PROCEDURE or Create FUNCTION button. A template similar to the following will be created:

DELIMITER \\

DROP PROCEDURE IF EXISTS `test`.`new_proc`\\
CREATE PROCEDURE `test`.`new_proc` ()
BEGIN

END\\

DELIMITER ;
  

After typing the procedure/function, click the Execute button above the script area or click the Execute option of the Script menu to create it.

To edit all stored procedures/functions at once, choose the Edit All Stored Procedures / Functions option of the Script menu. A new script editing tab will be created, containing all the stored procedures and stored functions for the current default database.

To remove an existing stored procedure or stored function, right-click on it in the database browser and choose the Drop Procedure or Drop Function option.

Top / Previous / Next / Up / Table of Contents
© 1995-2008 MySQL AB. All rights reserved.
  • Online Shop
  • Site Map
  • Legal
  • Contact Us
  • Job Opportunities
  • No Software Patents!