PDF (A4) - 41.5Mb
Man Pages (TGZ) - 272.3Kb
Man Pages (Zip) - 378.3Kb
Info (Gzip) - 4.1Mb
Info (Zip) - 4.1Mb
ALTER PROCEDUREproc_name [characteristic ...]characteristic: { COMMENT 'string' | LANGUAGE {SQL | JAVASCRIPT} | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA } | SQL SECURITY { DEFINER | INVOKER } | USING([library_reference][,library_reference][, ...])} This statement can be used to change the characteristics of a stored procedure. More than one change may be specified in anALTER PROCEDURE statement. However, you cannot change the parameters or body of a stored procedure using this statement; to make such changes, you must drop and re-create the procedure usingDROP PROCEDURE andCREATE PROCEDURE.
You must have theALTER ROUTINE privilege for the procedure. By default, that privilege is granted automatically to the procedure creator. This behavior can be changed by disabling theautomatic_sp_privileges system variable. SeeSection 27.2.2, “Stored Routines and MySQL Privileges”.
TheUSING clause is specific to stored programs written in JavaScript (seeSection 27.3, “JavaScript Stored Programs”), and allows you to specify a list of zero or more libraries to be imported by the stored procedure, causing any previous such list to be removed (just as it does withALTER FUNCTION). Possible results are listed here:
A
USINGclause is employed, and lists one or more libraries: Following execution of theALTER PROCEDUREstatement, the procedure imports only those libraries listed in theALTER FUNCTIONstatement; any libraries listed previously are removed from the list and no longer imported.The statement includes an empty
USINGclause: All libraries previously imported are removed from the list; the function no longer imports any libraries.USINGis not used: No changes are made to the list of libraries specified when the procedure was created.
Examples:
ALTER PROCEDURE myproc USING(lib1, lib2);(
USINGwith a non-empty list:) Following execution,myprocimportsonly the librarieslib1andlib2, and no other libraries.ALTER PROCEDURE myproc USING();(
USINGwith an empty list:) Following execution,myprocno longer imports any libraries at all.ALTER PROCEDURE myproc COMMENT "This procedure was altered";(No
USINGclause:) The procedure continues to import the same libraries as it did before this was issued.
PDF (A4) - 41.5Mb
Man Pages (TGZ) - 272.3Kb
Man Pages (Zip) - 378.3Kb
Info (Gzip) - 4.1Mb
Info (Zip) - 4.1Mb