MySQL with 2 stored procedures with return value and no return value

Source: Internet
Author: User

Procedure 1: With return value:

1 Drop procedure if existsProc_addnum;2 Create procedureProc_addnum (inchXint,inchYint, outsum int)3 BEGIN4 SET sum=X+y;5 End

Then, the execution process, the out output return value:

1 Call Proc_addnum (2,3,@sum); 2 Select @sum;

Procedure 2: No return value:

1 Drop procedure if existsProc_addnum;2 Create procedureProc_addnum (inchXint,inchYint)3 BEGIN4 DECLARE sum int;5 SET sum=X+y;6 SELECT sum;7 End

Execution process:

1 Call Proc_addnum (2,3);

MySQL with 2 stored procedures with return value and no return value

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.