Michael Peppler
Sybase Consulting
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
Sybase on Linux FAQ
Sybperl FAQ
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: ndronen at technolalia dot com
Subject: Re: Does DBD::Sybase strip spaces from padded VARCHARs?
Date: Apr 12 2004 2:27AM

On Sat, Apr 10, 2004 at 09:44:04PM -0700, Michael Peppler wrote:
> On Sat, 2004-04-10 at 18:17, wrote:

> > (I posted this to dbi-users yesterday, but no one's responded, so
> > here goes.)

Hi, Michael:

> It's the week-end :-)

Understood, and my apologies.

> > 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.
Just to be clear, we're not trying to store a space-padded VARCHAR.
We're trying to fetch a result set generated by a stored procedure
in which the VARCHAR columns are padded using convert().  The script
expects the result set from the stored proc to include the padding,
but the padding isn't included in the columns of the arrayref.

In the stored procedure, they've checked the length of the space-padded
VARCHAR after doing the convert(), and the spaces are there.  (All columns
are padded to the same length.) Do you know whether Open Client chomps
the spaces while returning the result set?