Mysql advanced storage process

Source: Internet
Author: User

Mysql advanced storage process

Similar to a function, a piece of code is encapsulated. to execute this piece of code, you can call this stored procedure. in the encapsulated statement body, you can use the if/else, case, while and other control structures. SQL programming is supported.

In mysql, what are the differences between stored procedures and functions,

One is with different names,

There is no return value for the stored procedure.

What if I want to obtain the return value? The out variable is OK!


View existing stored procedures:

Show procedure status

 

Delete stored procedure

Name of the Drop procedure Stored procedure

 

Call Stored Procedure

Call stored procedure name ();

1. Declare variables in the process


2 variables involved in calculation and simple control statements


3. Pass parameters to the stored procedure


4 while LOOP



5. Output Variables



6 switch statements


7. do while statement



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.