Subject Re: [firebird-support] How to get the type of a column?
Author Helen Borrie
At 01:21 PM 2/04/2011, you wrote:
>Hello everybody
>
>With the following sentence:
>SELECT R.RDB$FIELD_NAME, F.RDB$FIELD_TYPE FROM RDB$RELATION_FIELDS R JOIN
>RDB$FIELDS F ON RDB$FIELD_SOURCE = F.RDB$FIELD_NAME WHERE RDB$RELATION_NAME
>= 'CLIENTS'
>
>I can get the name and the numeric type of the columns, but I had not found
>as to get the name of the type (char, varchar, smallint, etc.)
>
>How I can to get the type's names?

Hint: table rdb$types where rdb$field_name = 'RDB$FIELD_TYPE'
Within this set,
rdb$fields.rdb$field_type corresponds with rdb$types.rdb$type and rdb$types.rdb$field_name gets you a name for the data type.

./hb