Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2004
    Posts
    3

    Unanswered: How to perform byte operation in oracle sql?

    Hello all,
    I am new user of oracle and is learning. And now I am
    working for a project which use oracle8.17.
    when writing stored procedure and trigger, I found I can
    not perform byte operation in oracle sql. For example,
    when '7 and 3', it shold come out with 3.
    But how can I do this in oracle sql?
    Is anyone can help me?
    Thanks a lot.

  2. #2
    Join Date
    Jan 2004
    Location
    Singapore
    Posts
    89

    Re: How to perform byte operation in oracle sql?

    Originally posted by LiuJianhui
    Hello all,
    I am new user of oracle and is learning. And now I am
    working for a project which use oracle8.17.
    when writing stored procedure and trigger, I found I can
    not perform byte operation in oracle sql. For example,
    when '7 and 3', it shold come out with 3.
    But how can I do this in oracle sql?
    Is anyone can help me?
    Thanks a lot.
    Are you speaking about the logical opertor AND. Please give the requirement more cleaarer. If possible, paste the query here.
    Thanks and Regards,

    Praveen Pulikunnu

  3. #3
    Join Date
    Jan 2004
    Posts
    370
    Use BITAND() function

  4. #4
    Join Date
    Mar 2004
    Posts
    3

    Unhappy Re: How to perform byte operation in oracle sql?

    Originally posted by praveenpr
    Are you speaking about the logical opertor AND. Please give the requirement more cleaarer. If possible, paste the query here.
    for example, I use a number type field for the following meaning:
    the first bit to recoed one operation status, and the second bit for the
    another status. If any data has both status, the first two bits in
    status field should be '11'. when I using the following sql to show them.

    select * from table1 where (status and 3) =3

    but it don't like other program language, It does not work in oracle.

  5. #5
    Join Date
    Mar 2004
    Posts
    3
    Thanks the experts for helping me.
    I use bitadd() function to perform this.
    but I has something to add. If I use the following sql

    select bitadd(7,3) from dual

    there will be some errors appear. so I modify the sql like this

    select bitadd(7,3)+0 from dual

    and it work well.

    thanks again.

Posting Permissions

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