hibernate query returns only first character of string

梦想的初衷 提交于 2019-12-06 04:34:35

问题


When I run a query like this in oracle 10g using sqldeveloper, it runs fine.

select 'Canada' as "country", emp.name as "name" from emp.

Gives me the name and country. When I run it in hibernate as a named query, I get only 'C' instead of 'Canada' for "country".

Why is this so?


回答1:


select cast('Canada' as varchar2(100)) as "country", emp.name as "name" from emp.



来源:https://stackoverflow.com/questions/5343355/hibernate-query-returns-only-first-character-of-string

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!