Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Manipulating 64 bit numbers in Pro*C

Manipulating 64 bit numbers in Pro*C

From: David Rajaratnam <David.Rajaratnam_at_dsto.defence.gov.au>
Date: 1997/11/03
Message-ID: <llra8yhol5.fsf@dsto.defence.gov.au>#1/1

Hi,

I was wondering if someone could give me some ideas on a problem I've got.

Basically, I'm want to store a 64 bit integer value in a column. Now, as I understand it Oracle can handle integers up to 10^38 which is easily big enough for my 2^64 (2^64 is around 10^20), so this isn't my problem :).

The problem I've got is how do I transfer this number between my Pro*C program and the oracle database. I do not want to assume that a long is 2^64 as this is compiler/machine dependant. Within my program I'm storing the number in a struct of 2 32 bit numbers. I assume what I'm going to have to do is put the numbers into an array and then bind the array to my NUMBER column. First of all, how do I do this, and second how do I cope with Big endian/little endian type problems.

I've tried to find information on this in the manuals and have also done a search on dejanews of the oracle newsgroups but have found nothing. I do suspect that this is most probably a result of my poor choice of keywords rather than the information not being available.

Anyway, thanks for your time

Dave R.

-- 

------------------------------------------------
David Rajaratnam Ph: (08) 8259 6501 ACC Group Fax: (08) 8259 6011 DSTO Australia
------------------------------------------------
Received on Mon Nov 03 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US