• Register
0 votes
28 views

Problem  :

I have a Stored procedure like below:

CREATE PROCEDURE MyProG()
  BEGIN
    SELECT * FROM `hs_hr_employee_leave_quota`;
  END

But it gives me the below error:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3

What does this error mean? What is wrong with my line number 2?

7 5 2
3,870 points

1 Answer

0 votes

Solution :

You have to change the delimiter before using the triggers, stored procedures and so on as shown below .

delimiter //
create procedure MyProG() 
begin 
SELECT * FROM hs_hr_employee_leave_quota;
end;//
delimiter ;

OR

Guide to find out what your MySQL Error is trying to say as below:

#1064 - You have an error in your SQL syntax;

Above error has no clues in it. So you have to double check all of your items to see where the mistake is:

1. You must have either omitted, or included an unnecessary symbol: !@#$%^&*()-_=+[]{}\|;:'",<>/?

2. You must have included a misplaced, missing or unnecessary keyword: select, into, or  the countless others.

3. You must have unicode characters that look like ascii characters in the query but are not recognized.

4. Misplaced, missing or the unnecessary whitespace or a newlines between keywords.

Remove as much as you can from your broken query until it starts working. And then use PostgreSQL next time that has a sane syntax reporting system.

9 7 4
38,600 points

Related questions

0 votes
1 answer 33 views
33 views
Problem : I am very new to the php and I am trying from long time but I cannot sort out the issue with my below code. Please let me know how can I fix the error? "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' '0')' at line 1"
asked Feb 3 jwilliam 3.9k points
0 votes
2 answers 55 views
55 views
Problem : Facing following mysql path error 'mysql' is not recognized as an internal or external command, operable program or batch file.
asked Nov 14, 2019 peterlaw 6.9k points
0 votes
2 answers 81 views
81 views
Problem : I have written the typical MyPersons table and I have also written the MyOrders table and it is defined in a particular way so that I can do the JOIN query like the below one to return the MyOrders for all of the MyPersons. SELECT MyPersons.LastName, ... my question is, how should I write the query that must return me all MyPersons with NO MyOrders? I must write this using Mysql.
asked Jan 27 jwilliam 3.9k points
0 votes
1 answer 57 views
57 views
Problem: I am little bit confused, which statement is true? In sql server, execute the sp_columns command to list all the columns in a table? True False
asked Feb 19 maddi86 5.4k points
0 votes
2 answers 127 views
127 views
Problem : I am trying to load my data into mysql database using below code LOAD DATA LOCAL INFILE A.txt INTO DB LINES TERMINATED BY '|'; A topic of my question is related to response I get. I understand a local data offloading is off by default and I have to enable it using following command local-infile=1 but I do not know how to execute this command.
asked Jan 28 jwilliam 3.9k points