MySQL Create stored process procedure

Source: Internet
Author: User


1.mySQL Create stored process procedure as follows:

/* The wonderful thing is to define a label [delimiter//] means procedure is not SQL, procedure's key word was eaten by the dog? */



2. Process Control Language If then end if


3.case when end case

.

4.while End While/* End while is light, this is different from Oracle */


5.loop End Loop Cycles:

6.repeat until end repeat;

/*set V=value;oralce v:=value;*/

/*oracle is not repeat, as does while*/


7.iterate/ * This feels a bit like go to Oracle also wood has * /


8. Continue handler for SQLState ' 23000 ' Set @xz = 1;

/* Unlike Oracle, @x defines an amount of time that is like SQL Server */


9.declare cur1 cursor FOR select id,data from Test.t1;

Open Cur1;close Cur1;





MySQL Create stored process procedure

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.