Problems with auto data transform when modifying column INT to INT8.
Posted in 2004
I am modifying a column type from INT to INT8 the server obviously calls
some conversion function and sets the new INT8 type to reflect the same
value.
HOWEVER my inteded use for INT was to store 32 bit values (interpreted by
my processes as unsigned). My intended use for INT8 is the same only 64
bits.
Unfortunately this modification (and conversion) does not maintain the bit
pattern and interpreted unsigned value.
eg:
INT = -1 ( 0xFFFFFFFF )
INT8 still = -1 but I suspect one of two kinds of content either:
data[1] 0x00000000
data[0] 0x00000001
sign = -1 ( if sign means the sign of the bits' absolute value )
OR
data[1] 0xFFFFFFFF
data[0] 0xFFFFFFFF
sign = -1 ( if sign means 'this is how I would like the user (some
program / dbaccess / etc ) to interpret (in 2s comp)' )
BUT........... ( I think )
The bit pattern certainly wonte be
data[1] 0x00000000
data[0] 0xFFFFFFFF
sign = 1
Is there a way, when I do my modify, that I can get informix to treat the
old value in the INT as an unsigned 32 bit number and set the new type INT8
accordingly ?
Andrew H
sending to informix-list