1

I'm using version 11.2 and there is no direct support for uint64 in table fields. What do you suggest to do performacewise? It must be the primary key.

Thanks

Marco Fiocco
  • 352
  • 2
  • 15

4 Answers4

1

possibly convert it to char, then insert it as a char, with a to_number to put it in the correct format?

EvilTeach
  • 28,120
  • 21
  • 85
  • 141
1

I know nothing about Oracle, but MS SQL is plagued similarly, and I ended up storing my 64-bit unsigned ints in binary(8) fields. If Oracle has similar field caps (and i can't imagine it doesn't) perhaps the same would work for you.

The upshot on SQL Server is binary(n) fields compared against other binary(n) fields effectively compare as byte-arrays, and if sized the same, it means they also compare as big-endian representation (if that is how you stored them, and you would be nuts not to).

Sorry I'm not Oracle savvy. Gotta dance with the one that brought ya =)

WhozCraig
  • 65,258
  • 11
  • 75
  • 141
1

I'm using a RAW(8) data type, and write it with:

uint64 i;
Bytes key((unsigned char*)&i, 8);
statement->setBytes(1, key);

Fast and compact, and seems to work well.

Marco Fiocco
  • 352
  • 2
  • 15
0

You can use number(20,0) as 64 bit integer is maxed at 18,446,744,073,709,551,615.
Using number type allows mathematical operationtoo.