18.6. Altering Stored Routines


The ALTER PROCEDURE or ALTER FUNCTION statement can be used to alter some of the characteristics of a stored routine:

 ALTER PROCEDURE proc_name [characteristics] ALTER FUNCTION func_name [characteristics] 

The allowable characteristics for these statements are SQL SECURITY and COMMENT. These have the same syntax as for the CREATE PROCEDURE and CREATE FUNCTION statements. For example, if a function currently has DEFINER security, you can change it to INVOKER security and add a comment as follows:

 ALTER FUNCTION f   SQL SECURITY INVOKER   COMMENT 'this function has invoker security'; 

As with the corresponding CREATE statements, the characteristics can be listed in any order if more than one is given.

These statements cannot be used to alter other aspects of routine definitions, such as the parameter declarations or the body. To do that, you must drop the routine first and then create it again with the new definition.



MySQL 5 Certification Study Guide
MySQL 5.0 Certification Study Guide
ISBN: 0672328127
EAN: 2147483647
Year: 2006
Pages: 312

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net