Subject | Need some help on unsigned integers (Cardinal) |
---|---|
Author | |
Post date | 2018-03-06T15:25:54Z |
Maybe i have not had the need to store Delphi "Cardinal" before.
I have a stored procedure that takes an INTEGER argument. (I cannot find any UINTEGER type in FB).
When i use this statement to set the value:
MyCol.AsLongWord = aCardinalParamValue;
I get an exception when the value exceeds the signed positive interval, for example: '2533700138' is not a valid integer value.
This is because the value gets converted to a 64-bit string in "SetAsLongWord" and then back to a signed 32.bit integer in TIB_ColumnInteger.SetAsString. That the TIB_ColumnInteger variant of SetAsString is called indicates to me that i have done something wrong. Maybe i should define the column differently? Or maybe simply cast all my Cardinals to signed 32-bit integers when storing and back when retrieving?
To sum it up: Does anyone have a good way of storing and retrieving unsigned 32-bit integers from FB 2.5-3.0 using IBO? I'd much grateful.
Regards,
/Dany