You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Sebastian Niezgoda <sn...@gestalt-llc.com> on 2007/06/14 17:13:56 UTC

Excess white space on SELECT

Hello,

I noticed that Derby does not trim any excess space on SELECT
statements.  I'm using iBatis to map sql to Java objects thus I am
forced to change my queries to trim.  Is there an easier way to do this?
Is there a global setting I can use when creating/connecting to Derby or
something along those lines?

Thanks,

Sebastian 

Re: Excess white space on SELECT

Posted by Sebastian Niezgoda <sn...@gestalt-llc.com>.
Yes, that is correct.  I am dealing with many CHAR and VARCHAR db fields
and I'm mapping them to Strings.  RTRIM works very well but I was hoping
to find somewhat of a more global solution.

I have no problem sticking to RTRIM, however, and I appreciate your
support.

Sebastian 

On Fri, 2007-06-15 at 11:25 -0700, Stanley Bradbury wrote:

> Sebastian Niezgoda wrote:
> > Hello,
> >
> > I noticed that Derby does not trim any excess space on SELECT 
> > statements.  I'm using iBatis to map sql to Java objects thus I am 
> > forced to change my queries to trim.  Is there an easier way to do 
> > this?  Is there a global setting I can use when creating/connecting to 
> > Derby or something along those lines?
> >
> > Thanks,
> >
> > Sebastian 
> Hi -
> I'm guessing you mean 'does not trim trailing space from the data values 
> returned'.  Derby should do this for VARCHAR fields but doesn't for 
> fixed length datatypes.  What datatypes are you retrieving and are you 
> performing conversions or concatenations in your select statements?
> 



Re: Excess white space on SELECT

Posted by Stanley Bradbury <St...@gmail.com>.
Sebastian Niezgoda wrote:
> Hello,
>
> I noticed that Derby does not trim any excess space on SELECT 
> statements.  I'm using iBatis to map sql to Java objects thus I am 
> forced to change my queries to trim.  Is there an easier way to do 
> this?  Is there a global setting I can use when creating/connecting to 
> Derby or something along those lines?
>
> Thanks,
>
> Sebastian 
Hi -
I'm guessing you mean 'does not trim trailing space from the data values 
returned'.  Derby should do this for VARCHAR fields but doesn't for 
fixed length datatypes.  What datatypes are you retrieving and are you 
performing conversions or concatenations in your select statements?