About an error encountered in MySQL stored procedure

Source: Internet
Author: User

Execution Result:

Inquire:Create procedureTest1 (outvar varchar( $)) Comment'Action Variables' begin Set var='MYSQL%ORCLE%DELL%IBM';Select Replace(var,'%'... Total0The execution time of the row affected:0sec Delivery Time:0.064sec Total Time:0.065sec--------------------------------------------------query: delimiter; error code:1064You have an errorinchyour SQL syntax;CheckThe manual that corresponds toYour MySQL server version forThe RightSyntax to  UseNear'delimiter'At line1

The SQL statement is:

DELIMITER//CREATE PROCEDURETest1 (outvar VARCHAR( $)) COMMENT'Action Variables'BEGIN        SET var='MYSQL%ORCLE%DELL%IBM'; SELECT REPLACE(var,'%','|') into var;END//DELIMITER;

Workaround:

The solution is simple, but it is not understood. Is behind the delimiter, '; ' Before the semicolon, add a space ! This is a completely unknown solution.

About an error encountered in MySQL stored 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.