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

Home -> Community -> Mailing Lists -> Oracle-L -> Re:

Re:

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Tue, 06 Jan 2004 03:54:30 -0800
Message-ID: <F001.005DBD73.20040106035430@fatcity.com>

How is the bit-stream presented ?
If it's a string, you could do something like:

select replace(replace('11010','1','11'),'0','00') from dual;

Regards

Jonathan Lewis
http://www.jlcomp.demon.co.uk

  The educated person is not the person
  who can answer the questions, but the
  person who can question the answers -- T. Schick Jr

One-day tutorials:
http://www.jlcomp.demon.co.uk/tutorial.html

Three-day seminar:
see http://www.jlcomp.demon.co.uk/seminar.html ____UK___November

The Co-operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html

> Hi,
>
> Well, since I can't sleep, I may as well try solving a problem.
>
> This is a bit odd, and I'm trying to think of the most efficient way to do
> it. I've set up some bitmaps in my app. Consider we have documents that
> we want to sell. In order to be able to sell a given doc, we need to have
it
> stored in the vault and we also need to have negotiated the proper
contract
> w/ the publisher. So, I've got two bitmaps, STORAGE and PERMISSIONS.
>
> But, here's the hook. There are 8 different types of storage, so I have
> an 8 bit mask. However, for every storage type, there are two types of
> permission. So, I have a 16 bit permissions mask.
>
> What I'd like to do is take my 8-bit STORAGE mask, say it's 10110011
> and convert it to 1100111100001111. Note that all I did there was take
> each bit in the input mask, and make the same value repeat. So, 0 would
> become 00, 1 would become 11, 10 would become 1100. Does that make sense?
> Once I've done that, I can take my STORAGE mask that's now stretched to 16
> bits, and directly AND it with my PERMISSIONS mask.
>
> So, my question is: Is there a nice, scalable way to take my 8 bits and
> expand them into 16 bits, in the way that I'm describing? A clever bit
> twiddling expression would be perfect, but anything that's efficient and
> scalable will do. (The end product will be hidden behind a view or stored
> procedure.)
>
> Any thoughts, anyone?
>
> Thanks in advance,
>
> -Mark
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.net
> --
> Author: Bobak, Mark
> INET: Mark.Bobak_at_il.proquest.com
>
> Fat City Network Services -- 858-538-5051 http://www.fatcity.com
> San Diego, California -- Mailing list and web hosting services
> ---------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Jonathan Lewis
  INET: jonathan_at_jlcomp.demon.co.uk

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Tue Jan 06 2004 - 05:54:30 CST

Original text of this message

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