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

Posted on 2010-01-08
Last Modified: 2012-08-13
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
Question by:PaultheBroker
    LVL 73

    Expert Comment

    "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.
    LVL 41

    Accepted Solution

    You could use RAW data type - ideal for bitwise oriented data.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    As they say in love and is true in SQL: you can sum some Data some of the time, but you can't always aggregate all Data all the time! Introduction: By the end of this Article it is my intention to bring the meaning and value of the above quote to…
    'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now