본문 바로가기

: IT

[SQL 에러] 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

반응형


 


error:org.apache.ibatis.exceptions.PersistenceException:

### Error querying database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 '.value, weightUnit weight.units, quantity, updatedQuantity, unitPrice,' at line 2

### The error may involve defaultParameterMap

### The error occurred while setting parameters

### SQL: SELECT          orderItemId, updatedOrderItemId, orderId, lineItemKey, sku, name, imageUrl, weightValue weight.value, weightUnit weight.units,           quantity, updatedQuantity, unitPrice, warehouseLocation, compared, modified         FROM OrderItem         WHERE modified = false

### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 '.value, weightUnit weight.units, quantity, updatedQuantity, unitPrice,' at line 2 



문제 원인 : 작은따옴표('')가 빠져있었다.

문제 해결 : weightUnit weight.units, weigtValue weight.value를 weightUnit 'weight.units', weightValue 'weight.value' 로 수정



반응형