Skip to Content.
Sympa Menu

freetds - Re: [freetds] trailing spaces

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT schemamania.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] trailing spaces
  • Date: Thu, 27 May 2004 20:20:34 -0400

On Thu, 27 May 2004 09:01:34 +0200, Michael Peppler <mpeppler AT peppler.org>
wrote:
> > $sth = $dbh->prepare($query);
> > print $sth->{"ChopBlanks"} = 1;
> >
> > doesn't alter whether or not the elements in the list returned by
> > $sth->fetchrow are trimmed.
>
> Actually it *does* work - but only on char() columns. varchars and
> things that are treated as varchar (i.e. nullable char) isn't affected
> as they *should* be trimmed already.

Oops. Sorry about that. My test was bogus.

Here's the output:

$ samples/test.pl mpquant $U $P "select '|' + cast(name as char(30)) + '|'
from systypes"
|image |
|text |
|uniqueidentifier |
|tinyint |
|smallint |
...

Of course, the blanks aren't trailing if the final character is a
nonblank.

--jkl






Archive powered by MHonArc 2.6.24.

Top of Page