bitwise operators ?

From: Mathieu Legare <Mathieu_Legare_at_uqtr.uquebec.ca>
Date: 2000/02/29
Message-ID: <38BBD901.9A700FEC_at_uqtr.uquebec.ca>#1/1


Hi,

[Quoted] I am using oracle 8.0.5 and pro*c 8.0.5.0.0 on AIX 4.2.1 and I was wondering if it's possible to do bitwise operations on a NUMBER field of an oracle database.

I am converting a C program that was using bitwise operators to manages some IDs.

#define ID_active = 0x00000001
#define ID_sleep = 0x00000002
#define ID_dead = 0x00000004

...
if((user.id & (ID_sleep | ID_dead)) == (ID_sleep | ID_dead)) {

   ...
}

Is there any operators or a way to do it with an SQL statement ? Is it possible to do bitwise AND or bitwise OR in oracle sql ? I know I can make a loop with a cursor and do this in C but it would probably be faster if I could do it in a single SQL statement

Thanks and have a nice day,

-- 
Mathieu Legare
Analyste en informatique (systeme/webmestre)
Service de l'informatique
Universite du Quebec a Trois-Rivieres
Email : Mathieu_Legare_at_uqtr.uquebec.ca
Tel : 376-5011 x2439
--
Received on Tue Feb 29 2000 - 00:00:00 CET

Original text of this message