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: Stephen dot Sprague at morganstanley dot com
Subject: numeric conversion behaviour
Date: Apr 7 2003 6:56PM

Hi good people.  I'm encountering this:

I'm having problems using nsql via sybase::ctlib. seems  the  underlying
call  to   ct_fetch   on   a   numeric(20)   column   whose   value   is
'1047389481776409' returns this '1.04738948177641e+15' in perl.

This is certainly not desirable as it drops precision. It's probably due
to the fact that the numeric is greater than 2^32. Is there anyway I can
get the numeric to translate to a character string within ctlib? I  have
'select *' all over my code; changing all references to explicitly state
the column names is not an option I really want to undertake.

This looks like a bug to me.  Comments?

Here's the code at line 1036 of Sybase::CTlib, v2.15.

 1036:                   while ( $data = $db->ct_fetch(0, 1) ) {

   DB<4> x $data
 0  ARRAY(0x69078c)
    0  '1.04738948177641e+15'