Subject Re: [firebird-support] View column datatype
Author Fabiano Bonin
Another test case (FB 2.1 CS, dialect 3)

create domain test_domain numeric(5,2);

recreate view test (
result )
as
select
cast(0 as test_domain)
from
rdb$database;

When i open the view in IBExpert, the domain of the column is
"RDB$111", its size is 9 and the precision is 2.

select
b.*
from
rdb$relation_fields a
inner join rdb$fields b on b.rdb$field_name = a.rdb$field_source
where
a.rdb$relation_name = 'TEST' and
a.rdb$field_name = 'RESULT';

RDB$FIELD_NAME = 'RDB$111',
RDB$QUERY_NAME = NULL,
RDB$FIELD_LENGTH = 4,
RDB$FIELD_SCALE = -2,
RDB$FIELD_TYPE = 8,
RDB$FIELD_SUB_TYPE = 1,
RDB$SYSTEM_FLAG = 0,
RDB$SEGMENT_LENGTH = NULL,
RDB$EDIT_STRING = NULL,
RDB$EXTERNAL_LENGTH = NULL,
RDB$EXTERNAL_SCALE = NULL,
RDB$EXTERNAL_TYPE = NULL,
RDB$DIMENSIONS = NULL,
RDB$NULL_FLAG = NULL,
RDB$CHARACTER_LENGTH = NULL,
RDB$COLLATION_ID = NULL,
RDB$CHARACTER_SET_ID = NULL,
RDB$FIELD_PRECISION = NULL



On Wed, Jun 18, 2008 at 2:57 PM, Fabiano Bonin
<fabiano@...> wrote:
> No, it is a dialect 3 database.
>
> I have just created a brand new database, dialect 3, FB 2.1, and got
> the same result.
>
> Looking at table RDB$FIELDS, i see the domain of the view field has
> RDB$FIELD_PRECISION = null
>
> Database "teste.fdb"
> Database header page information:
> Flags 0
> Checksum 12345
> Generation 1190
> Page size 4096
> ODS version 11.1
> Oldest transaction 1170
> Oldest active 1171
> Oldest snapshot 1171
> Next transaction 1175
> Bumped transaction 1
> Sequence number 0
> Next attachment ID 9
> Implementation ID 19
> Shadow count 0
> Page buffers 0
> Next header page 0
> Database dialect 3
> Creation date Jun 18, 2008 5:02:10
> Attributes force write
>