-
hi friends
can i use xor operator in oracle
i want a xor b xor c xor d
please help me
thank you
[Edited by rgharibnejad on 01-12-2002 at 06:59 AM]
-
If you want to use XOR as a bit-arithmetic operator, then use function SYS.UTL_RAW.BIT_XOR.
If you want to use it as a logical operator, then you can construct one yourself.
For example, you want the result of: "a XOR b", where a and b are expresions that can result in values 0 (FALSE) or 1 (TRUE) and the result of the XOR expression should also result in values 0 (FALSE) or 1 (TRUE). You can construct your own DECODE or CASE expression that returns the XOR result - here is an example with DECODE:
DECODE(a, b, 0, 1)
Or without DECODE or CASE you can use:
MOD(a+b, 2)
[Edited by jmodic on 01-12-2002 at 03:55 PM]
Jurij Modic
ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
-
hi jmodic,
how different is SIGN() function from DECODE or CASE.
thnx,
Cheers!
OraKid.
-
Originally posted by balajiyes
hi jmodic,
how different is SIGN() function from DECODE or CASE.
thnx,
I realy don't understande your question. I'm sure you know the difference between SIGN() and DECODE()/CASE, so what is your real question? To somehow construct XOR operator using solely SIGN() function? Can you explain a bit more?
Jurij Modic
ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|