[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2934) ScrollableResults.get(int column) returns only the first character of a database column type char(10)

Juan F Cervera (JIRA) noreply at atlassian.com
Tue Aug 19 06:26:39 EDT 2008


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2934?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_30933 ] 

Juan F Cervera commented on HHH-2934:
-------------------------------------

I had the same problem with Informix 10.
The solution proposed above by Mike Farewell works fine but, at least in Informix, you need to specify the size of the varchar in the casting or else it will continue to return just one character.

E.g. In the example above where alpaha_2 is size 2, you'd need to change the select an say:
cast(c.alpha_2 as varchar(2))

Hope it helps

> ScrollableResults.get(int column) returns only the first character of a database column type char(10)
> -----------------------------------------------------------------------------------------------------
>
>                 Key: HHH-2934
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2934
>             Project: Hibernate3
>          Issue Type: Bug
>          Components: query-sql
>    Affects Versions: 3.2.4.sp1
>         Environment: IBM DB2 8.1.7, 
>            Reporter: Samir Jyoti
>            Assignee: Diego Plentz
>
> ScrollableResults.get(int column) returns only the first character of a database column type char(n) where n> 1 (say 10 or 18).
> So if your column has value 'SIMPSON   ' , it only returns 'S'.
> Had to warp the column with a DB2 SQL "VARCHAR" function to convert it into a String.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list