• Register
0 votes

Problem  :

I have a Stored procedure like below:

    SELECT * FROM `hs_hr_employee_leave_quota`;

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

Please log in or register to answer this question.

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() 
SELECT * FROM hs_hr_employee_leave_quota;
delimiter ;


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 60 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, 2020 jwilliam 3.9k points
0 votes
2 answers 92 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 98 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, 2020 jwilliam 3.9k points
0 votes
2 answers 150 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, 2020 jwilliam 3.9k points
0 votes
2 answers 186 views
Problem : Looking for the solution of the following Security error. fatal error: please read "security" section of the manual to find out how to run mysqld as root!
asked Nov 12, 2019 peterlaw 6.9k points
0 votes
1 answer 10 views
Problem: I recently copied my mysql database to a new data directory and changed a few settings. I also accidentally deleted my / home / user directory and enjoyed recreating the fair. Now I can connect to mysql from the command line, but I cannot connect via phpMyAdmin. I ... phpto: $cfg['Servers'][$i]['host'] = ''; // previously 'localhost' I also tried unsuccessfully FLUSH PRIVILEGE.
asked Dec 30, 2020 sasha 5.3k points
0 votes
1 answer 153 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, 2020 maddi86 5.4k points
0 votes
1 answer 58 views
Problem: I am interested in learning MySQL. Currently I am facing the following error if I tried to add the index to my table using the MySQL Workbench: “Error Code: 2013. Lost connection to MySQL server during query.” I also noticed that above error appears only when I try to run long query. I want to know the away to increase my timeout value?
asked Jul 27, 2020 Raphael Pacheco 4.9k points
0 votes
1 answer 99 views
Problem : I am new to MySQL and facing following error message while trying to connect my DB: "Lost connection to MySQL server at 'reading initial communication packet, system error: 0" If I am trying to connect my MySQL DB to the localhost then everything is working as ... ") or die(mysql_error()); Does anyone ever faced such issue? Also please let me know the solution for this issue if possible.
asked Nov 22, 2019 peterlaw 6.9k points