PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: ndronen at technolalia dot com
Subject: Does DBD::Sybase strip spaces from padded VARCHARs?
Date: Apr 11 2004 1:17AM

Hi,

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

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.  The data is going to
be written to a file and FTP'ed to another vendor's site, and the
idea is that the Perl program shouldn't have to know the layout of
the data.  If the table changes, the script shouldn't break.  Hence
the padding.

As I suspected, since the datatype is VARCHAR not CHAR, setting
$sth->{ChopBlanks} = 0 as well as passing ChopBlanks => 0 in the
%attr arg of connect() did not change the behavior I'm seeing.

Any suggestions?

Regards,

Nicholas