Hibernate query - field length, pulling wrong record


G

getdgbmail

I am using a Hibernate query in JAVA to retrieve data from an iSeries file.The field length of fieldName in my query WHERE clause is 4 long. There is a record in the file with a field name of BLUE. When I run the query using BLUE_GREEN, this record is selected. BLUE_GREEN is not BLUE, so I don'twant this field to be selected. Why is this happening?



WHERE
fieldName = :fieldName
 
Ad

Advertisements

J

Josip Almasi

I am using a Hibernate query in JAVA to retrieve data from an iSeries file.
The field length of fieldName in my query WHERE clause is 4 long. There is a
record in the file with a field name of BLUE. When I run the query using
BLUE_GREEN, this record is selected. BLUE_GREEN is not BLUE, so I don't want
this field to be selected. Why is this happening?



WHERE
fieldName = :fieldName

AFAIK hibernate does not truncate strings to field lengths.
It may be doing of either jdbc driver or database.
Guess you should start by googling 'iseries jdbc truncate':)

Regards...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top