db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rajesh Kartha <karth...@gmail.com>
Subject Re: How should trailing spaces be treated in key fields
Date Wed, 03 May 2006 22:44:54 GMT
Steve Bosman wrote:

> Hi,
> The application I'm writing is copying records from an Oracle database
> to a Derby database and today I have been getting error 23505 (showing
> a primary key constraint violation) when two records have a key value
> differing by a trailing space, e.g. one record has the value 'treat 3'
> in one of its key fields and the other record has the value 'treat 3 '
> in the same key field. Can anyone tell me if this the correct Derby
> behaviour and I'll have to learn to live with it of if this is a bug.
>
> thanks
>
> Steve


As I understand, Derby preserves leading spaces but trims trailing ones. So
I  think what you are observing is expected.

Example;
ij> select *  from t1;
ID         |COL1
------------------
1          |te 3
1          | te 3
1          |  te 3


Regards,
Rajesh

Mime
View raw message