Skip to content
Advertisement

Firebird SQL Statement to Get the Table Definition

I am writing my own Firebird database browser using the ibpp library. Is there a way I can get the table definition using an SQL statement?

Advertisement

Answer

Firebird does not support schemas, so there is no way you can get that information.

The closest thing might be the owner, which you can get by querying RDB$RELATIONS

Edit

A “schema” is a namespace inside a database. Apparently you are looking for the table definition, not the schema.

You can retrieve the colums of a table and their datatypes by querying RDB$FIELDS and RDB$RELATION_FIELDS:

The datatype is stored as an integer in the column RDB$FIELD. The full list of values in that column is documented in the Interbase Reference Guide: http://www.ibphoenix.com/files/60LangRef.zip (as are all other columns in that system table and all other system tables as well). You might need to go through all the update guides to check if there were any changes to the system tables since IB 6.0 (The Firebird manualy are a **reall* mess)

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement