I'm getting trailing spaces in my data fields in my DBI selects on
informix data.
Does anyone have a workaround or bug fix for this problem?
I'm using perl version 5.005_03 built for i386-linux
Red Hat Linux release 6.0 (Hedwig)
Kernel 2.2.5-15 on an i686
DBD - Informix.pm,v 60.6
DBI.pm,v 10.25
Example:
Here's my table and data:
create table cust (
cust_num char(10),
cust_name char(20)
);
insert into cust values ("A15","John Doe")
Here's my perl code:
$sql_stmt = "select cust_num, cust_name from cust where cust_num =
\"A15\" ";
my $cursor = ($dbh)->prepare($sql_stmt) || die $dbh->errstr;
$cursor->execute || die $dbh->errstr;
}
print "[$cust_name]\n";
Results:
[John Doe ]
I don't want the trailing spaces. Even when no data is returned from
a particular column, I get spaces in my fields.
Thanks,
Spaced Out