Re: SQL Exception
Posted by: Todd Farmer
Date: September 17, 2013 07:49AM

Hi Jegadheesh,

The problem is pretty much exactly what the message states - the SQL statement you're attempting to execute can't be parsed properly by the MySQL Server. These error messages don't always capture the real syntax problem, and that seems to be the case here. For example, the error message you report can be triggered by not including column name, or by having a trailing comma after the last column name:

mysql> SELECT from sdsemp where sdsid=1;
ERROR 1064 (42000): 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 'from
sdsemp where sdsid=1' at line 1

mysql> SELECT test, from sdsemp where sdsid=1;
ERROR 1064 (42000): 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 'from
sdsemp where sdsid=1' at line 1

You'll need to review the SQL command in full to identify the problem. If the SQL is being dynamically generated, you might want to enable the MySQL general query log (or audit log plugin, for commercial builds) to capture the actual SQL being sent.

Hope that helps!

--
Todd Farmer
MySQL @ Oracle
http://www.oracle.com/mysql/

Options: ReplyQuote


Subject
Written By
Posted
September 17, 2013 03:00AM
Re: SQL Exception
September 17, 2013 07:49AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.