Up Prev Next
From: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: Does DBD::Sybase strip spaces from padded VARCHARs?
Date: Apr 11 2004 4:44AM
On Sat, 2004-04-10 at 18:17, email@example.com wrote:
> (I posted this to dbi-users yesterday, but no one's responded, so
> here goes.)
It's the week-end :-)
> I'm using DBD::Sybase 1.02 and DBI 1.42.
> The stored procedure writer here is telling me that she's sending
> a VARCHAR that's padded with spaces, but the spaces aren't there
> when I retrieve them with fetchrow_arrayref.
See my answer in dbi-users - varchar() values are always truncated of
any trailing whitespace when they are inserted to a table.
DBD::Sybase doesn't have any method for forcing whitespace padding of
varchar() values, so your options are to convert the varchar columns to
char() columns in the stored proc itself, or to pad the columns yourself
in your perl script.
Michael Peppler Data Migrations, Inc.
Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short or
long term contract positions - http://www.peppler.org/resume.html