Mysql Stored Procedure

Source: Internet
Author: User

Mysql Stored Procedure

Note: The difference between stored procedures and functions: stored procedures do not return values. 1. view the Stored procedure show procedure status \ G2, delete the Stored procedure drop procedure stored procedure name 3. create procedure stored procedure name (n int) beginif j = 'H' then select * from g where num> n; else select * from g where num <n; end $4. Call the stored procedure: call stored procedure name (); Example 1: create procedure p1 (n smallint) begin declare I int; declare s int; set I = 1; set s = 0; while I <= n do set s = s + I; set I = I + 1; end while; select s; end $

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.