Subject Re: extract metadata problem
Author bramvandervoet
Thanks Martijn, I just want to extract fieldname, type + lenght from
a table in a database and not depending on a component. Should this
really be so difficult ???
Bram



--- In ib-support@y..., "Martijn Tonies" <martijn@b...> wrote:
> Bram,
>
> take your time to read through the Language Reference chapter System
> Tables and Views. Also take time to read the Data Definition Guide
and
> you will see that both NUMERIC and DECIMAL aren't stored as such.
>
> Extracting detailed metadata information is an error prone task -
no-one
> gets it right the first, second and third time.
>
> Depending on what you actually want, why don't you use existing
code?
> IBX, IBO and probably FIBPlus all have their metadata extract
> components. Heck, even browsing the IBConsole code at SourceForge
should
> get you going.
>
>
> Martijn Tonies
> InterBase Workbench - the developer tool for InterBase and Firebird
> http://www.interbaseworkbench.com
>
>
>
> With the following sql, fieldtype: nummeric, lenght: 18, scale: 2
are
> not shown. Any idea why?
> Thanks Bram
>
> select
> r.rdb$relation_name as tablename,
> r.rdb$field_name as fieldname,
> t.rdb$type_name as typename,
> f.rdb$field_length as fieldlength, r.RDB$FIELD_SOURCE AS
> DOMAINFIELD
> from
> rdb$relation_fields r, rdb$types t, rdb$fields f
> where
> r.rdb$relation_name='MATFAC' and
> r.rdb$relation_name not like 'RDB%' and
> f.rdb$field_name=r.rdb$field_source and
> t.rdb$field_name='RDB$FIELD_TYPE' and
> f.rdb$field_type=t.rdb$type
> order by
> r.rdb$relation_name