Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2002
    Posts
    3

    Unanswered: Bit wise operations

    I am in the process of converting a Sybase routine to Oracle 8.1.6. There is a select statement which uses bit wise operations such as:
    select x,y,z
    from xtable
    where xfield & 36 and 12 = yfield and
    name = "myuser";

    Is there a way to do this in Oracle?

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: Bit wise operations

    Originally posted by pamdesign
    I am in the process of converting a Sybase routine to Oracle 8.1.6. There is a select statement which uses bit wise operations such as:
    select x,y,z
    from xtable
    where xfield & 36 and 12 = yfield and
    name = "myuser";

    Is there a way to do this in Oracle?
    Oracle has a function called BITAND:

    select x,y,z
    from xtable
    where TO_NUMBER(BITAND(xfield,36)) > 0 and 12 = yfield and
    name = "myuser";

  3. #3
    Join Date
    Dec 2002
    Posts
    3

    Bit wise operations

    Thanks, I appreciate it!

    Pam Richardson

  4. #4
    Join Date
    Apr 2002
    Location
    California, USA
    Posts
    482

    Smile

    Good job, andrewst. Never knew such function existed, but seems Oracle has big bag of tricks...

    Thanks for the tip,

    clio_usa
    OCP - DBA

  5. #5
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    Originally posted by clio_usa
    Good job, andrewst. Never knew such function existed, but seems Oracle has big bag of tricks...

    Thanks for the tip,

    clio_usa
    OCP - DBA
    Visit our Web Site
    Well, I just stumbled over it myself recently while looking for something else!

Posting Permissions

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