Easy access to the "MySQL" database stored procedure _ MySQL

Source: Internet
Author: User
Easy access to the "MySQL" database stored procedure 1. create a stored procedure

1. basic syntax:

Create procedure sp_name ()

Begin

.........

End

2. parameter transfer

II. call the stored procedure

1. basic syntax: call sp_name ()

Note: the stored procedure name must be enclosed in parentheses, even if the stored procedure has no parameters

III. delete stored procedures

1. basic syntax:

Drop procedure sp_name //

2. Notes

(1) you cannot delete another stored procedure in one stored procedure. you can only call another stored procedure.

4. blocks, conditions, and loops

1. Block definition, commonly used

Begin

......

End;

You can also create an alias for the block, such:

Lable: begin

...........

End lable;

You can use leave lable to jump out of the block and execute code after the block.

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.