var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Bitwise operation in DB2
Assume that TABLE.STATUS = 01010010 and we want to test if a particular bit ( let us say bit 2 xxxxxx1x) is true or false;
Can you do bit operations such as the following:
SELECT * FROM TABLE A WHERE A.STATUS & (0x20) == TRUE;
In DB2 can we can do bit manipulations similar to the above?
how to check the bit status in db2
If you want to test if the second bit of a number XXXX1X is set, you can test like
select from table.status where table.status mod 2 = 0.
If testing for second bit, where table.status mod 4 = 0, and so on for nth bit
use mod 2 to the power of n-1.
Does not work in all situations
I tried that but it does not work in all cases.