What is the best way to store a bitmask with over 2,000 bits (10^600)

I want to use a bitmask to hold over 2000 binary states.  So I'm reckoning that I'm going to need a field that is at least 2000 bits long (i.e. 2^2000 or 10^602) .  Inbuilt numbers in oracle have a scale of -84 to +127, so thats not going to be big enough, I think...

Because one of the cool things about bitmasks is the ability to do quick bitwise compairsons to check for on/off, I was hoping to have the db treat this bitmask as a number.  Of course I could be missing something...

Other alternatives I though of would be to split the single bitmask into several smaller ones - in which case this question reverts to - "what is the largest bit number i can store"

I'm using Oracle 11g...Thanks!....Paul
LVL 6
PaultheBrokerAsked:
Who is Participating?
 
pcelbaCommented:
You could use RAW data type - ideal for bitwise oriented data.
0
 
sdstuberCommented:
"what is the largest bit number i can store"

the largest integer is number(38,0)   meaning 38 decimal digits
which translates to 127 bits but only 126 of which are fully useable.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.