Documentation Home
MySQL 9.3 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 40.8Mb
PDF (A4) - 40.9Mb
Man Pages (TGZ) - 261.1Kb
Man Pages (Zip) - 368.3Kb
Info (Gzip) - 4.1Mb
Info (Zip) - 4.1Mb


MySQL 9.3 Reference Manual  / ...  / SQL Statements  / Data Definition Statements  /  ALTER FUNCTION Statement

15.1.4 ALTER FUNCTION Statement

ALTER FUNCTIONfunc_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 function. More than one change may be specified in anALTER FUNCTION statement. However, you cannot change the parameters or body of a stored function using this statement; to make such changes, you must drop and re-create the function usingDROP FUNCTION andCREATE FUNCTION.

You must have theALTER ROUTINE privilege for the function. (That privilege is granted automatically to the function creator.) If binary logging is enabled, theALTER FUNCTION statement might also require theSUPER privilege, as described inSection 27.8, “Stored Program Binary Logging”.

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 function, causing any previous such list to be removed, just as it does withALTER PROCEDURE. SeeSection 15.1.8, “ALTER PROCEDURE Statement”, for more detailed information.