doing logical (bitwise) comparions.. AND, OR, etc
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: doing logical (bitwise) comparions.. AND, OR, etc

  1. #1
    I have several SQL processes that each have their own value...1,2,4,8,16, etc... if the steps 1,2,4 must execute before step 8 I can have each step look at the values already ran.. i.e. 1,2,3,4,5,6,7.
    If the total is 5 for instance, I know I ran steps 1 and 4, but not 2.

    The problem is I am trying to do this via code... is there a way to do a bitmap AND of two numbers?

    i.e. If I do a bitmap NOT AND of 2 and 5, I will get zero, for those of you who know how to do this. C/C+ has simple functions... is there one in PL/SQL?

    i.e. 2 = 0000 0010
    5 = 0000 0101
    NAND= 0000 0000 = 0



    Share on Google+

  2. #2

    got it

    simpy use utl_raw...

    to do a NOT AND (XAND) of 4 and 7)..
    the result if true, is the original number (4), a false return is zero

    select utl_raw.bit_and (hextoraw(4), utl_raw.bit_xor(hextoraw(4), hextoraw(7))) from dual
    Share on Google+

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width