Oracle 5.0 Reference Manual page 2892

Table of Contents

Advertisement

MySQL 5.0 FAQ: Stored Procedures and Functions
B.4.2: Where can I find documentation for MySQL stored procedures and stored functions?
See
Section 18.2, "Using Stored Routines (Procedures and
B.4.3: Is there a discussion forum for MySQL stored procedures?
Yes. See http://forums.mysql.com/list.php?98.
B.4.4: Where can I find the ANSI SQL 2003 specification for stored procedures?
Unfortunately, the official specifications are not freely available (ANSI makes them available for
purchase). However, there are books—such as SQL-99 Complete, Really by Peter Gulutzan and
Trudy Pelzer—which give a comprehensive overview of the standard, including coverage of stored
procedures.
B.4.5: How do you manage stored routines?
It is always good practice to use a clear naming scheme for your stored routines. You can manage
stored procedures with
[FUNCTION|PROCEDURE], and
DROP
information about existing stored procedures using the
database (see
Section 19.8, "The
B.4.6: Is there a way to view all stored procedures and stored functions in a given database?
Yes. For a database named dbname, use this query on the
SELECT ROUTINE_TYPE, ROUTINE_NAME
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_SCHEMA='dbname';
For more information, see
The body of a stored routine can be viewed using
or
SHOW CREATE PROCEDURE
Syntax", for more information.
PROCEDURE
B.4.7: Where are stored procedures stored?
In the
table of the
proc
the system database directly. Instead, use
stored functions, and
SHOW CREATE PROCEDURE
Section 13.7.5.8,
"SHOW CREATE PROCEDURE
You can also query the
"The
INFORMATION_SCHEMA ROUTINES
B.4.8: Is it possible to group stored procedures or stored functions into packages?
No. This is not supported in MySQL 5.0.
B.4.9: Can a stored procedure call another stored procedure?
Yes.
B.4.10: Can a stored procedure call a trigger?
A stored procedure can execute an SQL statement, such as an UPDATE, that causes a trigger to
activate.
B.4.11: Can a stored procedure access tables?
Yes. A stored procedure can access one or more tables as required.
CREATE
[FUNCTION|PROCEDURE],
SHOW CREATE
INFORMATION_SCHEMA ROUTINES
Section 19.8, "The
INFORMATION_SCHEMA ROUTINES
(for a stored procedure). See
system database. However, you should not access the tables in
mysql
SHOW CREATE FUNCTION
table in the
ROUTINES
Table", for information about this table.
2872
Functions)".
ALTER
[FUNCTION|PROCEDURE]. You can obtain
table in the
ROUTINES
INFORMATION_SCHEMA.ROUTINES
SHOW CREATE FUNCTION
Section 13.7.5.8,
to obtain information about stored procedures. See
Syntax", for more information about these statements.
INFORMATION_SCHEMA
[FUNCTION|PROCEDURE],
INFORMATION_SCHEMA
Table").
Table".
(for a stored function)
"SHOW CREATE
to obtain information about
database—see
Section 19.8,
table:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents