Subject Re: [firebird-support] Get create table SQL from system tables
Author Ann W. Harrison
Martijn Tonies wrote:
> Hello,
>
>> 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.

Good luck,

Ann