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: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: numeric conversion behaviour
Date: Apr 7 2003 7:04PM

On Mon, 2003-04-07 at 11:56, Stephen.Sprague@morganstanley.com wrote:
> 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.

Short-term solution, use the UseNumeric database handle attribute.

See also the message from d.desseaux@circo.fr a few days ago regarding
bug #261, which I claim was fixed in sybperl 2.11. However, the fix was
never correctly implemented (ahem!). I hope to have a fix for this in
the next few days.

Michael
-- 
Michael Peppler                              Data Migrations, Inc.
mpeppler@peppler.org                 http://www.mbay.net/~mpeppler
Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short or 
long term contract positions - http://www.mbay.net/~mpeppler/resume.html