• Register
0 votes
80 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

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() 
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 130 views
130 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
1 answer 4 views
4 views
Problem: it outputs the error: Syntax error or access violation: 1064 No idea how to fix this. any ideas?
asked Mar 22 ummesalma 22k points
0 votes
1 answer 19 views
19 views
Problem: mysql is not recognized as an internal or external command.
asked Feb 18 charles mathews 5.5k points
0 votes
2 answers 150 views
150 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
1 vote
1 answer 3 views
3 views
Problem: Any solution to this error? Securityerror: error #2060: security sandbox violation.
asked Mar 28 PkGuy 13.1k points
0 votes
1 answer 29 views
29 views
Problem : mysql server version for the right syntax to use near '' at line 1
asked Feb 13 Shovo210 13.2k points
0 votes
1 answer 1 view
1 view
Problem: I am facing problem with mysql non root/admin user, I am following the below steps for creating user and its privileges, correct me if i am doing wrong, i am installing mysql on RHEL 5.7 64bit, packages are mentioned below, once i done the rpm install we ... Access denied for user 'golden'@'localhost' (using password: YES) This is the problem I am facing, is there any solution to this?
asked 1 day ago Atik03 4.1k points
0 votes
1 answer 2 views
2 views
Problem: Please assist me in resolving this issue: you have an error in your sql syntax near ' '' at line 1
asked Apr 1 rakib1 50.4k points
0 votes
1 answer 28 views
28 views
Problem: cara mengatasi you have an error in your sql syntax near ' '' at line 1
asked Feb 12 Dan phillip 4.1k points
0 votes
2 answers 127 views
127 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