Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Bit Function

Re: Bit Function

From: <xmark.powell_at_eds.com.x>
Date: 17 Apr 2001 13:13:35 GMT
Message-ID: <9bhfhv$vua$1@news.netmar.com>

In article <9bhd00$moc$1_at_news.att.net.il>, Dudi Naim <yoramn_at_cti2.com> writes:
>Hi all
>
>How can I do bit function (like or xor and) between 2 numbers in PLSQL ?
>
>thanks
>
>yoramn_at_cti2.com
>
>

I believe that the bitand function is now listed in the SQL manual. If not Oracle has published queries using the function in the OPS Concepts manual.

Here is some code I saved off a post in the past. I have not tested it nor did I verify the url is still valid:

http://www.oradba.freeserve.co.uk/tips/bitwise_ops.htm CREATE OR replace FUNCTION bitor( x IN NUMBER, y IN NUMBER ) RETURN NUMBER AS
BEGIN
    RETURN x + y - bitand(x,y);
END;
/

CREATE OR replace FUNCTION bitxor( x IN NUMBER, y IN NUMBER ) RETURN NUMBER AS
BEGIN
    RETURN bitor(x,y) - bitand(x,y);
END;

Received on Tue Apr 17 2001 - 08:13:35 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US