Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

xor in PL/SQL

1,425 views
Skip to first unread message

Finn Nova

unread,
Feb 27, 2002, 5:25:07 AM2/27/02
to
Hi all,

is there a xor operator in PL/SQL?
We are using Oracle 8i.

Regards,

Finn

NetComrade

unread,
Feb 27, 2002, 6:46:23 PM2/27/02
to
shouldn't be too complicated to write one.

.......
We use Oracle 8.1.6-8.1.7 on Solaris 2.6, 2.7 boxes
Andrey Dmitriev eFax: (978) 383-5892 Daytime: (917) 750-3630
AOL: NetComrade ICQ: 11340726 remove NSPAM to email

Vladimir M. Zakharychev

unread,
Feb 28, 2002, 10:19:35 AM2/28/02
to
There is UTL_RAW.BIT_XOR function if that helps.

--
Vladimir Zakharychev (b...@dpsp-yes.com) http://www.dpsp-yes.com
Dynamic PSP(tm) - the first true RAD toolkit for Oracle-based internet applications.
All opinions are mine and do not necessarily go in line with those of my employer.


"Finn Nova" <finn...@yahoo.de> wrote in message
news:b32e8107.02022...@posting.google.com...

Adrian Carlson-Hedges

unread,
Feb 28, 2002, 1:37:15 PM2/28/02
to

"Finn Nova" <finn...@yahoo.de> wrote in message
news:b32e8107.02022...@posting.google.com...

Let me see. Roughly

If A Then
IF B then
false
ELSE
true
END IF
ELSE
IF B then
true
ELSE
false
END IF
END IF

OR

IF ((A OR B) AND NOT(A AND B))

I'm sure there are plenty of other ways

Adrian


Finn Nova

unread,
Mar 1, 2002, 4:26:43 AM3/1/02
to
Hi,

thank you all for your more or less helpful posts.
I know how to implement xor myself, but I wanted to know if I have
overseen something about xor in the documentation.
Xor is implemented in most CPUs. I don't understand why I should write
code (that will take a lot longer to execute) for an operation that is
already there as hardware.

Finn

"Adrian Carlson-Hedges" <adri...@btinternet.com> wrote in message news:<a5ltcr$96k$1...@helle.btinternet.com>...

Nuno Souto

unread,
Mar 1, 2002, 4:59:32 AM3/1/02
to
Finn Nova doodled thusly:

>Xor is implemented in most CPUs. I don't understand why I should write
>code (that will take a lot longer to execute) for an operation that is
>already there as hardware.


Well, strictly speaking it's not already there. Most CPU's can do XOR
between two single words (32-bits in most cases). But when it comes
to XOR of strings (of bytes or otherwise) most require code as well.

Having said that, XOR in PL/SQL (and SQL) is long overdue. I lost
count of the number of times I could have used it and had to dig out
my Karnaugh maps to get an efficient XOR coded...

Listening, Mr Oracle? Pretty please?


Cheers
Nuno Souto
nso...@optushome.com.au.nospam

damorgan

unread,
Mar 1, 2002, 11:38:10 AM3/1/02
to
How about it Tom? Can you lobby on our behalf?

Daniel Morgan

Ted McCabe

unread,
Mar 1, 2002, 7:49:33 PM3/1/02
to
Have you looked at utlraw.bit_xor
hth
tED

"Finn Nova" <finn...@yahoo.de> wrote in message
news:b32e8107.02022...@posting.google.com...
0 new messages