开发者

hibernate query returns only first character of string

开发者 https://www.devze.com 2023-02-17 07:07 出处:网络
When I run a query like this in oracle 10g using sqldeveloper, it runs fine. selec开发者_开发百科t \'Canada\' as \"country\", emp.name as \"name\" from emp.

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

selec开发者_开发百科t '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?


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

精彩评论

暂无评论...
验证码 换一张
取 消