pl/sql bit operations

 There is a built-in bitand operator in Oracle but no bitor or bitxor operators. Below, definitions for those operators can be found:

  Create Function bitor(x In Number, y In Number)
    Return Number deterministic parallel_enable
  Is
  Begin
    Return x + y – bitand(x, y);
  End bitor;

  Create Function bitxor(x In Number, y In Number)
    Return Number deterministic parallel_enable
  Is
  Begin
    Return bitor(x, y) – bitand(x, y);
  End bitxor;

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s