I'm writing a DB2 user-defined function for which I need an array of non-negative integers, which I represent as a varchar for bit data. I plan to use two bytes for each integer (giving me a maximum value of 2^16-1, which is acceptable).
I can convert an integer to a char for bit data by using the chr function, but how do I get it back to an integer?
Any additional advice on bit manipulation in DB2 procedures would be helpful as well, as I can't seem to find much documentation on it. I'm using v9.1 on Linux.