Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Trucos (https://www.clubdelphi.com/foros/forumdisplay.php?f=52)
-   -   Listar tablas y vistas, incluidas y no incluidas las del sistema (https://www.clubdelphi.com/foros/showthread.php?t=80835)

jhonny 15-08-2007 18:44:05

Listar tablas y vistas, incluidas y no incluidas las del sistema
 
Para listar las tablas y las vistas de una BD FireBird, incluidas las del sistema:

Código SQL [-]
select DISTINCT RDB$RELATION_NAME from RDB$RELATION_FIELDS

Y bueno, para listar las tablas y las vistas de una BD FireBird, sin incluir las del sistema, hay varios metodos pero uno de tantos es el siguiente:

Código SQL [-]
select DISTINCT RDB$RELATION_NAME from RDB$RELATION_FIELDS
where RDB$SYSTEM_FLAG = 0

Pero si lo que queremos es listar solo las tablas, sin vistas, ni las tablas del sistema, podemos hacer lo siguiente:

Código SQL [-]
select T.RDB$RELATION_NAME from RDB$RELATIONS T
where T.RDB$SYSTEM_FLAG = 0 and
T.RDB$RELATION_NAME not in (select V.RDB$VIEW_NAME from RDB$VIEW_RELATIONS V)


La franja horaria es GMT +2. Ahora son las 08:54:16.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi