Arquivo para Janeiro, 2008

Interbase/Firebird INFORMATION_SCHEMA

O standard SQL 2003 inclui um novo schema chamado INFORMATION_SCHEMA, PostgreSQL, SQL Server e MySql usam-no.

ORACLE, DB2, Sybase, Ingres, Informix e outras DBMS usam algo parecido chamado de System Tables. o Firebird usa METADATA TABLES, cujos nomes começam por “RDB$”.

Para listar todas as tables e views da Base de Dados:

  SELECT DISTINCT RDB$RELATION_NAME
  FROM RDB$RELATION_FIELDS
  WHERE RDB$SYSTEM_FLAG=0;

ou

  SELECT RDB$RELATION_NAME
  FROM RDB$RELATIONS
  WHERE RDB$SYSTEM_FLAG=0;

apenas tables:

  SELECT DISTINCT RDB$RELATION_NAME
  FROM RDB$RELATION_FIELDS
  WHERE RDB$SYSTEM_FLAG=0
  AND RDB$VIEW_CONTEXT IS NULL;

mais info em:
http://www.alberton.info/firebird_sql_meta_info.html
http://www.tecnobyte.com.br/dica9.html#dica208

Deixe um comentário

Tools for Firebird developers

FBCopy

  • copy and compare data between Firebird databases
  • runs on Windows and Linux
  • automatically loads tables and compares their fields
  • uses Foreign Keys and Checks to determine the correct order of tables
  • can create ALTER TABLE and CREATE TABLE scripts needed to update the destination database
  • HTML overview of differences in data and metadata

FBExport

  • export and import data from Firebird databases
  • command line and GUI version
  • runs on Windows and Linux
  • export to comma separated values (CSV) format
  • export as INSERT statements
  • use exported data in DML statements
  • handles NULLs and BLOBs properly
  • ability to execute sql scripts from a file

 Homepage: http://fbexport.sourceforge.net/

Deixe um comentário