Oracle 5.0 Reference Manual page 1208

Table of Contents

Advertisement

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 //
mysql>
CREATE PROCEDURE p1 ()
->
BEGIN
->
DECLARE fanta INT DEFAULT 55;
->
DROP TABLE t2;
->
LOOP
->
->
->
END//
Query OK, 0 rows affected (0.00 sec)
mysql>
SHOW PROCEDURE CODE p1//
+-----+----------------------------------------+
| Pos | Instruction
+-----+----------------------------------------+
|
0 | set fanta@0 55
|
1 | stmt 9 "DROP TABLE t2"
|
2 | stmt 5 "INSERT INTO t3 VALUES (fanta)" |
|
3 | jump 2
+-----+----------------------------------------+
4 rows in set (0.00 sec)
In this example, the nonexecutable
DECLARE variable_name
assigned). For each statement that is taken from source, there is a code word
(9 means DROP, 5 means INSERT, and so on). The final row contains an instruction
GOTO instruction
SHOW PROCEDURE CODE
13.7.5.26.
SHOW PROCEDURE STATUS
SHOW PROCEDURE STATUS
[LIKE 'pattern' | WHERE expr]
This statement is a MySQL extension. It returns characteristics of a stored procedure, such as the
database, name, type, creator, creation and modification dates, and character set information. A
similar statement,
Section 13.7.5.16,
The
[896]
LIKE
clause can be given to select rows using more general conditions, as discussed in
"Extensions to
mysql>
SHOW PROCEDURE STATUS LIKE 'sp1'\G
*************************** 1. row ***************************
Name: sp1
Type: PROCEDURE
Definer: testuser@localhost
Modified: 2004-08-03 15:29:37
Created: 2004-08-03 15:29:37
Security_type: DEFINER
Comment:
You can also get information about stored routines from the
INFORMATION_SCHEMA. See
13.7.5.27.
SHOW PROCESSLIST
SHOW [FULL] PROCESSLIST
SHOW PROCESSLIST
the
mysqladmin processlist
INSERT INTO t3 VALUES (fanta);
END LOOP;
statement, only the executable part appears (the part where the default is
#2.
was added in MySQL 5.0.17.
SHOW FUNCTION
"SHOW FUNCTION STATUS
clause, if present, indicates which procedure or function names to match. The
Statements".
SHOW
Db: test
Section 19.8, "The
Syntax
shows you which threads are running. You can also get this information using
command. If you have the
Syntax
SHOW
|
|
|
|
and
statements have disappeared, and for the
BEGIN
END
Syntax
STATUS, displays information about stored functions (see
Syntax").
INFORMATION_SCHEMA ROUTINES
1188
stmt
table in
ROUTINES
[577]
privilege, you can see all
PROCESS
followed by a type
2, meaning
jump
WHERE
Section 19.18,
Table".

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents