Reputation: 11
I am using a middleware system to connect to a Database system. We are using a lookup functionality which in turn creates an SQL Query based on the conditions we have provided in it.
SELECT "FunctionCode", "AUM", "Numerator", "Denominator", "EANUPC", "Length", "Width", "Height", "CategoryofEAN" FROM "tblIdocAlternateUOMs" WHERE MaterialNumber='09792021'
Error:
'Error processing request in sax parser: Error when executing statement for table/stored proc. 'table' (structure 'statement'): com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near 'FunctionCode'.'.
I have executed the above query in database system and it is working fine without the errors but I am seeing the error in my system when I am trying to retrieve the data from DB.
DB System : Microsoft SQL SERVER
Could you please let me know why are these kind of errors usually appear?
Upvotes: 0
Views: 1616
Reputation: 3484
SELECT
FunctionCode,
AUM,
Numerator,
Denominator,
EANUPC,
Length,
Width,
Height,
CategoryofEAN
FROM
tblIdocAlternateUOMs
WHERE
MaterialNumber='09792021'
one thing keep in mind that only value needs quotation mark and that is single quotes... nor field name...
Remove that quotation mark from coding side query.... Just because of this its hapening
Upvotes: 13