How to Read the SQL of a Routine in MySQL
In MySQL and other database formats, extended and interlinked chains of commands are stored in a routine. Routines are very useful if you have a series of tasks or commands that you need to issue. If you have created a routine, or if another administrator has created one, you can read the SQL syntax of that routine in MySQL. Routines can be created, altered, executed or dropped. To view the SQL of an existing routine, you "alter" it without changing anything.
Instructions
-
-
1
Log in to your MySQL database in the command line, either remotely via the secure shell (SSH) or directly into the shell on the machine.
-
2
Type "USE dbname" (without quotes, replacing dbname with the database name) and press "Enter."
-
-
3
Type "ALTER PROCEDURE name" replacing "name" with the name of the routine you want to read. Press "Enter."
-
4
Press "Enter" to read each level of the routine, be careful not to change anything.
-
1