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: 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, wrote:
> Hi,
> (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 -