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: arthur at puma dot mt dot att dot com (Arthur Goldstein)
Subject: numerics and db-lib
Date: Jan 20 1999 3:41AM

When retreiving numeric data it is returned as a string with many spaces
after it when
using dblib, but not ctlib.  How can one get it to return a proper
number?

I.e. within table_t column_c is defined as numeric(10).

$db->dbcmd("select column_c from table_t");
$db->dbsqlexec;
$db->dbresults;
($value) = ($db->dbnextrow());
print "'$value'";

Might result in
'1
'
as opposed to '1'.

ct-lib seems to behave as desired.

Thanks,
Arthur Goldstein
arthur.goldstein@att.com
(Current solution is to redo the sql as:
 $db->dbcmd("select convert(int, column_c) from table_t") which doesn't
seem nice.)