Question

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

Was it helpful?

Solution 3

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.

OTHER TIPS

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

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 =)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top