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

Home -> Community -> Usenet -> c.d.o.server -> Re: bitwise or on column

Re: bitwise or on column

From: kopek <matezuka_at_yahoo.com>
Date: 30 Jul 2002 11:06:07 -0700
Message-ID: <f7cb1d69.0207301006.25549b10@posting.google.com>


Your function counts the number of bits that have been turned on for ONE given number. This is not what I understand a bitor to be. A bitor compares TWO numbers , identifies the bit that has been turned on in either numbers, and returns to you the number resulted from the bit comparison. Not sure how you going to do a bitor with just one number.

Martin Haltmayer <Martin.Haltmayer_at_d2mail.de> wrote in message news:<3D3BE614.4CFF6F48_at_d2mail.de>...
> Hi Stephan,
>
> in 8.1.7.2.1 this one worked:
>
> create or replace function bitor (i_bf in number) return number parallel_enable
> is
> l_retval number:= 0;
> l_bf number:= i_bf;
> begin
> while l_bf > 0 loop
> l_retval:= l_retval + mod (l_bf, 2);
> l_bf:= trunc (l_bf/2);
> end loop;
> return l_retval;
> end bitor;
> /
>
> Regards,
>
> Martin
>
>
>
> Stephan Bressler wrote:
> >
> > Hi all,
> >
> > I'm looking for a function doing a bitwise or on a column (number)
> > containing permissions, e.g. 1=read, 2=write, 4=exec, ... (so 5 = exec+read
> > permission).
> > There are several rows per user and all permissions should be aggregated.
> > The function should be used like
> >
> > select bitor(permissions)
> > from acl
> > where username='scott tiger';
> >
> > TIA
> > Stephan
Received on Tue Jul 30 2002 - 13:06:07 CDT

Original text of this message

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