[firebase-br] TABELAS E CAMPOS
Gustavo Moda
gustavo.moda em gmail.com
Sex Dez 5 17:18:18 -03 2008
Nas tabelas de "sistema"! Ler elas POOODDEEE!
Fiz a query abaixo para usar na versão 1.5 e funciona..
SELECT
RDB$RELATIONS.RDB$RELATION_ID
, RDB$RELATIONS.RDB$RELATION_NAME TABELA
, RDB$RELATION_FIELDS.RDB$FIELD_NAME AS FNAME
, RDB$RELATION_FIELDS.RDB$NULL_FLAG AS NFLAG
, RDB$RELATION_FIELDS.RDB$DEFAULT_SOURCE AS DSOURCE
, RDB$RELATION_FIELDS.RDB$DEFAULT_VALUE AS DVALUE
, RDB$RELATION_FIELDS.RDB$RELATION_NAME AS TNAME
, RDB$FIELDS.RDB$FIELD_NAME AS DNAME
, RDB$FIELDS.RDB$FIELD_TYPE AS FTYPE
, RDB$FIELDS.RDB$FIELD_SUB_TYPE AS STYPE
, RDB$FIELDS.RDB$FIELD_LENGTH AS FLEN
, RDB$FIELDS.RDB$COMPUTED_SOURCE AS CSOURCE
, RDB$FIELDS.RDB$FIELD_PRECISION AS FPREC
, RDB$FIELDS.RDB$FIELD_SCALE AS FSCALE
, RDB$FIELDS.RDB$SEGMENT_LENGTH AS SEGLEN
, RDB$TYPES.RDB$TYPE_NAME DESC_TIPO
, RDB$FIELDS.RDB$FIELD_SCALE ESCALA
, RDB$FIELDS.RDB$FIELD_SUB_TYPE SUBTIPO
, RDB$FIELDS.RDB$CHARACTER_LENGTH TAM_CHAR
FROM RDB$FIELDS
INNER JOIN RDB$TYPES ON (RDB$FIELDS.RDB$FIELD_TYPE =
RDB$TYPES.RDB$TYPE AND RDB$TYPES.RDB$FIELD_NAME = 'RDB$FIELD_TYPE')
INNER JOIN RDB$RELATION_FIELDS ON
(RDB$FIELDS.RDB$FIELD_NAME = RDB$RELATION_FIELDS.RDB$FIELD_SOURCE)
INNER JOIN RDB$RELATIONS ON
(RDB$RELATION_FIELDS.RDB$RELATION_NAME =
RDB$RELATIONS.RDB$RELATION_NAME)
WHERE RDB$FIELDS.RDB$SYSTEM_FLAG = 0 -- AND
RDB$RELATIONS.RDB$RELATION_NAME IN ('noem da tabela')
order by
RDB$RELATIONS.RDB$RELATION_ID,RDB$RELATION_FIELDS.RDB$FIELD_POSITION
2008/12/5 joao_jma <joao_jma em itelefonica.com.br>:
> como extrair nomes das tabelas e dos campos de um banco firebird usando o ZEOS ???
>
>
> abraço
>
> João M. de Amorim - Informática:
> Andreza Enxovais - Ibitinga/SP
> ((16) 3341-9000
> È(16) 9239-0959
>
> ______________________________________________
> FireBase-BR (www.firebase.com.br) - Hospedado em www.locador.com.br
> Para saber como gerenciar/excluir seu cadastro na lista, use: http://www.firebase.com.br/fb/artigo.php?id=1107
> Para consultar mensagens antigas: http://firebase.com.br/pesquisa
>
Mais detalhes sobre a lista de discussão lista