[freetds] trailing spaces

James K. Lowden jklowden at schemamania.org
Thu May 27 20:20:34 EDT 2004


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





More information about the FreeTDS mailing list