Re: DB2 Bit question

Re: DB2 Bit question

 

  

Dear Lazy DBAs:

What you want is a "bitwise" function such as ORACLE's BITAND.

Fortunately this has already been developed as a UDF (User Defined Function) to assist those who are migrating from ORACLE to DB2.

Take a look at this article and download the associated file for the source code.

http://www-128.ibm.com/developerworks/db2/library/samples/db2/0205udfs/index.html

Best, Hal Steiner
Bloomberg LP

-----Original Message-----
From: Ramon Santiago <db2udbdba-ezmlmshield-x83128326.[Email address protected]
To: LazyDBA Discussion <[Email address protected]
Sent: Mon, 24 Apr 2006 10:47:30 -0500
Subject: DB2 Bit question


Does anyone have a sql they can share to determine if a specific bit is on?

ie...

I have a field which is a 1 character field that I need to determine if
bit...5 is on going from right to left.

ie... 00010000 The datatype of the field is char(1).





---------------------------------------------------------------------
PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
website: http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html

DB2 & UDB email list listserv db2-l LazyDBA home page