Subject Re: [IBO] Integer Field in Delphi
Author Helen Borrie
At 09:16 PM 27/08/2003 +0000, you wrote:
>Hi all.
>
> I'd like to test in delphi (using TIB_Cursor or TIB_Query) if a
>Database (Firebird 1.5) field is an integer field like this:
>
> if cursor1.fields[0].IsInteger then...
>
> But the "IsInteger" is not available. I found IsNumeric but I can
>use it to test Integer fields or Float fieds?

Yes, you can use it to determine whether the field is numeric. Then, after
that, test SQLScale to determine whether it is (by its DDL definition) an
integer type (smallint, integer or a 64-bit integer type).

> What do I use to test Integer fields?

if cursor1.fields[0].IsNumeric then
if cursor1.fields[0].SQLScale = 0 then....

You need the IsNumeric test because many non-numeric types also have zero
scale.

Helen