MySQL stored procedure definition and invocation

Source: Internet
Author: User

#MySQL存储过程 # #最简单的存储过程DROP PROCEDURE IF EXISTSSP1;CREATE PROCEDURESP1 () COMMENT'The simplest stored procedure'     SELECT 1; # #调用CALL SP1 (); # #带输入参数的存储过程DROP PROCEDURE IF EXISTSSP2;CREATE PROCEDURESP2 (inchPINT) COMMENT'stored procedure with input parameters'    SELECTp;# #调用CALL SP2 (1); #带输出参数的存储过程DROP PROCEDURE IF EXISTSSP3;CREATE PROCEDURESP3 (out QINT) COMMENT'stored procedure with output parameters'    SELECT 1  intoq; #调用CALL SP3 (@r);SELECT @r; #带输入和输出参数的存储过程DROP PROCEDURE IF EXISTSSP4;CREATE PROCEDURESP4 (inchPINT, Out QINT) COMMENT'stored procedures with input and output parameters'    SELECTP intoq; #调用CALL SP4 (1,@r);SELECT @r;

MySQL stored procedure definition and invocation

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.