我有 play framework(scala) 在我的操作系统 ubuntu 上使用 mysql
我有示例代码
val computers = SQL(
"""
select * FROM 'computer'
where 'computer.tytul' like {filter}
order by {orderBy} nulls last
limit {pageSize} offset {offset}
"""
).on(
'pageSize -> pageSize,
'offset -> offest,
'filter -> filter,
'orderBy -> orderBy
).as(Computer.withCompany *)
当我将它与 MySQL 一起使用时会产生以下错误
[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 ''computer' where 'computer.tytul' like '%%' order by 2 nulls' at line 1]
该代码与内存中的数据库一起工作!
有人可以帮忙吗?
最佳答案
我认为如果您完全删除引号(或使用反引号,如 Carsten 所建议的那样),它会起作用。
这是文档:http://dev.mysql.com/doc/refman/5.0/en/identifiers.html
关于mysql - 玩框架scala和mysql报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18334283/