MySQL stored procedures

Source: Internet
Author: User


Querying stored procedures in a database
Method One:
Select ' Name ' from Mysql.proc where db = ' your_db_name ' and ' type ' = ' PROCEDURE '
Method Two:
Show procedure status;
To view the creation code for a stored procedure or function
Show CREATE PROCEDURE Proc_name;
Show Create function Func_name;
Querying stored procedures and functions in a database
Method One:
Select ' Name ' from Mysql.proc where db = ' your_db_name ' and ' type ' = ' PROCEDURE '//stored procedure
Select ' Name ' from Mysql.proc where db = ' your_db_name ' and ' type ' = ' function '//functions
Method Two:
Show procedure status; Stored Procedures
Show function status; Function
To view the creation code for a stored procedure or function
Show CREATE PROCEDURE Proc_name;
Show Create function Func_name;
View View
SELECT * from INFORMATION_SCHEMA. Views//View
SELECT * from INFORMATION_SCHEMA. TABLES//Table
View triggers
Method One:
Syntax: SHOW TRIGGERS [from db_name] [like expr]
Example: SHOW triggers\g//Trigger
Method Two:
Querying the Triggers table in the INFORMATION_SCHEMA database
Mysql>select * FROM triggers T WHERE trigger_name= "Mytrigger" \g

MySQL stored procedures

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.