Rechercher dans le manuel MySQL
13.7.6.27 SHOW PROCEDURE CODE Syntax
This statement is a MySQL extension that is available only for
servers that have been built with debugging support. It displays
a representation of the internal implementation of the named
stored procedure. A similar statement, SHOW
FUNCTION CODE
, displays information about stored
functions (see Section 13.7.6.19, “SHOW FUNCTION CODE Syntax”).
To use either statement, you must have the global
SELECT
privilege.
If the named routine is available, each statement produces a
result set. Each row in the result set corresponds to one
“instruction” in the routine. The first column is
Pos
, which is an ordinal number beginning
with 0. The second column is Instruction
,
which contains an SQL statement (usually changed from the
original source), or a directive which has meaning only to the
stored-routine handler.
- mysql> DELIMITER //
- -> BEGIN
- -> LOOP
- Query OK, 0 rows affected (0.00 sec)
- +-----+----------------------------------------+
- | Pos | Instruction |
- +-----+----------------------------------------+
- | 1 | stmt 9 "DROP TABLE t2" |
- | 2 | stmt 5 "INSERT INTO t3 VALUES (fanta)" |
- | 3 | jump 2 |
- +-----+----------------------------------------+
In this example, the nonexecutable BEGIN
and
END
statements have disappeared, and for the
DECLARE
statement,
only the executable part appears (the part where the default is
assigned). For each statement that is taken from source, there
is a code word variable_name
stmt
followed by a type (9
means DROP
, 5 means
INSERT
, and so on). The final row
contains an instruction jump 2
, meaning
GOTO instruction #2
.
Document created the 26/06/2006, last modified the 26/10/2018
Source of the printed document:https://www.gaudry.be/en/mysql-rf-show-procedure-code.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.