Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2002
    Posts
    1

    Red face Unanswered: how to make bit arithmetic with plsql

    Hey,

    it is possible, to make bit-arithmetic with plsql like

    update XXX set BITFIELD = BITFIELD | 8 (OR-Operation)

    update XXX set BITFIELD = BITFIELD & 8 (AND-Operation)

    (Synthax from Sybase)

    In plsql there are only BITAND() and BIN_TO_NUM() - functions.

    Now, I have solved this problem with macroprogramming. But the precompiled SQL-Code is unreadable for the normal-sql-programmer.

    Thanx for information

    matten

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

    Re: how to make bit arithmetic with plsql

    There is only the BITAND function. However you can write your own BITOR function like this:

    create or replace function bitor( x integer, y integer ) return integer is
    begin
    return x+y-bitand(x,y);
    end;

Posting Permissions

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