Handle Bitwise Field?

From: Ashok Rathi <arathi_at_impresse.com>
Date: Mon, 28 Sep 1998 14:34:15 -0700
Message-ID: <6uovdv$eh7$1_at_news.bayarea.net>



[Quoted] If I have a column which is BITWISE-OR'ed combination of 4 values based on the bit position, is there any easy way to form SQL Query. Take an example,

0x00 means {Order Received}
0x01 means {Order Approved}
0x02 means {Order Paid For}
0x04 means {Order Shipped}

So, the value of '0x03' should represent the first three statuses and '0x07' should represent all statuses. If I query for the orders which are approved (0x01) and paid for(0x02), the result should also include the records with the status 0x07.

What is the best way to query for the BITWISE-OR fields in Oracle other than with all possible combinations of ORs?

Tx.

  • Ashok
Received on Mon Sep 28 1998 - 23:34:15 CEST

Original text of this message