MySQL Advanced stored procedure

Source: Internet
Author: User

Concepts similar to functions,is to encapsulate a piece of code.,when it comes to executing this piece of code,,You can call this stored procedure to implement the.inside the encapsulated statement body,can be usedIf/else, Case,whileand other control structures.can beSQLProgramming.

In MySQL , the difference between stored procedures and functions ,

One is a different name ,

Two is a stored procedure that has no return value .

What if you want to get the return value? Ok! by out-of-nature variables


To view an existing stored procedure :

Show Procedure Status

To delete a stored procedure

the name of the Drop procedure stored procedure

Call a stored procedure

Call stored procedure name ();

1 declaring variables inside a procedure


2 variable participation operations and simple control statements


3 passing parameters to a stored procedure


4 While Loop



5 Output Type variable



6 Switch statements


7 Do and statements



MySQL Advanced stored procedure

Related Article

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.