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.)
|