An error occurred while creating the stored procedure using SQL statements in MySQL and DOS: Error 1064 (42000 ):

Source: Internet
Author: User

 

The content of update1. SQL is

Drop procedure if exists pcname;
Create procedure pcname ()
Begin
Select 'a ';

End;

 

Execute the following command in DOS:

C: \ szxys \ metsdatabase \ mysql \ bin> mysql-uUnsername-PPassword Dbname<Update1. SQL

Syntax Error reported

Error 1064 (42000): You have an error in your SQL syntax;Www.kobsky.cn eye-catching world'

Check the manual that corresponds to your MySQL Server version...

Cause:

In dos, the semicolon (;) is used as the end character of the stored procedure, so an error occurs.

Solution: add the delimiter keyword and declare the symbol as the delimiter for the end of the stored procedure. Modify the symbol as follows to execute

 

Drop procedure if exists pcname;

Delimiter $
Create procedure pcname ()
Begin
Select 'a ';
End;

$

Delimiter;

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.