Subject Re: [firebird-support] Get create table SQL from system tables
Author Martijn Tonies

>>> Where in the system tables do I get (with a select SQL) the CREATE TABLE
>>> statement
>>> of a table that exists in the database? We are on FB 1.5.
>> You don't, you either use a GUI tool like Database Workbench
>> or another tool that creates such a statement by querying the
>> system tables and constructing the statement.
> Or use ISQL to extract all the statements necessary to recreate
> the database.
> Firebird stores its metadata in normalized relational tables not
> .frm files. To be confusing, it uses somewhat archaic academic
> terminology. You'll find tables and views in RDB$RELATIONS,
> domains in RDB$FIELDS, columns in RDB$RELATION_FIELDS, the mapping
> from views to tables in RDB$VIEW_RELATIONS, etc. The extract.cpp
> file in ISQL has all the code to recreate definitions.

Couldn't remember if ISQL did that ;-)

Anyway, Ann, does ISQL also support metadata for single objects?

With regards,

Martijn Tonies
Upscene Productions

Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!

Database questions? Check the forum: