Oracle 5.0 Reference Manual page 1044

Table of Contents

Advertisement

CREATE PROCEDURE
CREATE
[DEFINER = {
user
FUNCTION
sp_name
RETURNS
type
[characteristic
...]
proc_parameter:
[ IN | OUT | INOUT ]
func_parameter:
param_name type
type:
Any valid MySQL data type
characteristic:
COMMENT 'string'
| LANGUAGE SQL
| [NOT] DETERMINISTIC
| { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }
| SQL SECURITY { DEFINER | INVOKER }
routine_body:
Valid SQL routine statement
These statements create stored routines. By default, a routine is associated with the default database.
To associate the routine explicitly with a given database, specify the name as
when you create it.
The
CREATE FUNCTION
See
Section 21.2, "Adding New Functions to
function. Stored functions share their namespace with UDFs. See
Parsing and
Resolution", for the rules describing how the server interprets references to different kinds
of functions.
To invoke a stored procedure, use the
a stored function, refer to it in an expression. The function returns a value during expression evaluation.
As of MySQL 5.0.3,
CREATE PROCEDURE
[576]
privilege. They might also require the
ROUTINE
value, as described later in this section. If binary logging is enabled,
DEFINER
might require the
SUPER
Programs".
By default, MySQL automatically grants the
privileges to the routine creator. This behavior can be changed by disabling the
automatic_sp_privileges
MySQL
Privileges".
The
and
DEFINER
SQL SECURITY
access privileges at routine execution time, as described later in this section.
If the routine name is the same as the name of a built-in SQL function, a syntax error occurs unless you
use a space between the name and the following parenthesis when defining the routine or invoking it
later. For this reason, avoid using the names of existing SQL functions for your own stored routines.
The
[536]
IGNORE_SPACE
permissible to have spaces after a stored routine name, regardless of whether
enabled.
The parameter list enclosed within parentheses must always be present. If there are no parameters, an
empty parameter list of
Each parameter is an
IN
or
before the parameter name.
OUT
INOUT
and
| CURRENT_USER }]
([func_parameter[,...]])
routine_body
param_name type
statement is also used in MySQL to support UDFs (user-defined functions).
MySQL". A UDF can be regarded as an external stored
statement (see
CALL
and
[578]
privilege, as described in
ALTER ROUTINE
[437]
system variable. See
clauses specify the security context to be used when checking
SQL mode applies to built-in functions, not to stored routines. It is always
should be used. Parameter names are not case sensitive.
()
parameter by default. To specify otherwise for a parameter, use the keyword
1024
Syntax
CREATE FUNCTION
Section 9.2.3, "Function Name
Section 13.2.1,
require the
CREATE FUNCTION
[578]
privilege, depending on the
SUPER
Section 18.6, "Binary Logging of Stored
[576]
and
Section 18.2.2, "Stored Routines and
db_name.sp_name
"CALL
Syntax"). To invoke
CREATE
CREATE FUNCTION
[577]
EXECUTE
IGNORE_SPACE
[536]
is

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents