Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Returning large numbers to Pro*C variable
Hi Peter,
Original author (adas1_at_spspay.com) wanted to use number(12) Oracle datatype. There are no problems with converting 12-digit integers to doubles. As far as I remember, it is safe up to 15-digit integers.
Andrew Protasov
Peter Sylvester wrote in message <352AC117.E97DF623_at_mitre.org>...
>I think you may lose some precision with doubles. If you want to preserve
>everything you probably have to fetch into a character string and use
atoll().
>
>Peter
>
>Andrew Protasov wrote:
>
>> Hi,
>>
>> There are no 8-byte integers (type 3) as external datatype in OCI.
>> They can be only of 1, 2 or 4 bytes. Try to use double (type 4).
>> 8-byte doubles will represent your 12-digit integers without loss
>> of precision.
>>
>> Andrew Protasov
>>
>> adas1_at_spspay.com wrote in message <6gaqj1$e05$1_at_nnrp1.dejanews.com>...
>> >Hi
>> >Does anyone have ant experience retrieving large integer values
>> >from an Oracle Sequence ?
>> >I am trying to retrieve a large number (Number (12)) from an Oracle
>> >Sequence into a Pro*C variable defined as "long long int" which is a
8-byte
>> >integer. This has been uncessful thus far as only the 4 leading bytes
are
>> >populated and the trailing 4 bytes left untouched.
>> >Is there any other way to handle this except declare the return
>> >variable as a char string ?
>> >
>> >TIA
>> >
>> >-----== Posted via Deja News, The Leader in Internet Discussion ==-----
>> >http://www.dejanews.com/ Now offering spam-free web-based newsreading
>
>
>
Received on Wed Apr 08 1998 - 09:06:54 CDT
![]() |
![]() |