In Oracle8i I have a column defined as Number(10) to store a 32-bit IP address in. In order to perform comparisons on the address, I need it to be stored as an unsigned 32-bit integer. I have tried declaring the query field as otInteger, otFloat, otString... pretty much everything. But it is being inserted as a negative number. For example, 3323018795 gets stored as -971948501. While these are equivalent values when looking at the bits, they are not equivalent according to Oracle. The following query does not return a row:
So, does anyone know how to force an integer to be stored as unsigned? Oh, I am using Delphi5 and the IP address is kept in a longword, which causes Delphi to treat them as unsigned so that less-than/greater-than comparisons work.
Code:
SELECT 1 FROM dual WHERE 3323018795 = -971948501;