|
|
sybperl-l Archive
Up Prev Next
From: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: question on rounding up
Date: Oct 15 1999 5:09PM
Konrad Zak writes:
> hello.
> with following lines i'm trying to get identyfier value for known to me
> NAZWA_1 value:
>
> $SQL_helpquery = "select ORGANIZACJA_ID from ORGANIZACJA where NAZWA_1 =
> \"$hashRef{'NAZWA_1'}[0]\"";
> $ref = $d->ct_sql($SQL_helpquery);
>
> and ... perl round ORGANIZACJA_ID=100000...000015 up to 100000...00002,
> this is "print @$ref->[0][0];" output:
>
> 1.00000000000002e+15
>
> how can I avoid this? I'll appreciate every advice. best regards.
If you have the latest sybperl I think you can say $dbh->{UseChar} = 1
to tell sybperl to convert very large numeric values to strings
instead of numbers. The problem you are seeing is that your very large
numeric value doesn't fit in a 32 bit int.
In general I've found that using identity values beyond decimal(9,0)
creates more problems than it solves, unless you *really* expect to
have a *huge* amount of rows in your database.
Michael
--
Michael Peppler -||- Data Migrations Inc.
mpeppler@peppler.org -||- http://www.mbay.net/~mpeppler
Int. Sybase User Group -||- http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com
|