[QODBC-Desktop] Troubleshooting: Expected lexical element not found
Posted by Rajendra Dewani (QODBC Support) on 31 October 2012 11:51 AM
Troubleshooting: Expected lexical element not found
When trying to execute a query statement, I get the error message " Expected lexical element not found "
It seems to be the issue in the SQL Statement. Please check all the field names and table names. Normally this could be a typo error in the field name in your SQL Statement. To know more about the fields and data layout, please Click Here
Another Possible Problem & Solution:
When I issue SQL statement:
SELECT Desc FROM Charge
I get "Expected lexical element not found: = <identifier>"
However, if I issue
Select * from Charge
Then, I get a full output, with one of the columns named "Desc".
Why can't I query for the column by name?
I have tried this through the QODBC Support Wizard and through a C# program as well.
I would like to inform you that Desc may be a reserved word in SQL; due to this, you are getting this error. I kindly request you to please put quotes around "Desc". Please use the below query, which does not issue an error:
SELECT "Desc" FROM Charge