Informix XPS and BIT operations
Posted in 2000
Topics: General Discussion
Sirs: I have seen a few messages concering bit-wise operations, but i still have a problem. I would like to bit-encode data into an integer field. however, I do not see any bitwise operatiors like OR AND XOR. Has anyone determined a workaround for this? Can I create custome functions in informix that can then be used in SQL statements? if so does anyone have examples? we are using XPS version 8.11.UF1x9 adam
In the sysmaster database is the stored procedure bitval to test if a bit is set and you can always use arithmetic '+' and hex strings to update the bits: SELECT sysmaster:bitval( 0x10, maskcolumn ) bit_16 FROM mytest WHERE ....; UPDATE mytest SET maskcolumn = maskcolumn + 0x10 WHERE ....; See also the samples in the VIEWS defined in sysmaster.sql. Art S. Kagel Adam Richards wrote: > > Sirs: > I have seen a few messages concering bit-wise operations, but i still > have a problem. > I would like to bit-encode data into an integer field. however, I do > not see any bitwise operatiors like OR AND XOR. > > Has anyone determined a workaround for this? > Can I create custome functions in informix that can then be used in SQL > statements? > if so does anyone have examples? > > we are using XPS version 8.11.UF1x9 > adam
In the sysmaster database is the stored procedure bitval to test if a bit is set and you can always use arithmetic '+' and hex strings to update the bits: SELECT sysmaster:bitval( 0x10, maskcolumn ) bit_16 FROM mytest WHERE ....; UPDATE mytest SET maskcolumn = maskcolumn + 0x10 WHERE ....; See also the samples in the VIEWS defined in sysmaster.sql. Art S. Kagel Adam Richards wrote: > > Sirs: > I have seen a few messages concering bit-wise operations, but i still > have a problem. > I would like to bit-encode data into an integer field. however, I do > not see any bitwise operatiors like OR AND XOR. > > Has anyone determined a workaround for this? > Can I create custome functions in informix that can then be used in SQL > statements? > if so does anyone have examples? > > we are using XPS version 8.11.UF1x9 > adam