How do I get a list of tables from a Firebird database?
Question:
So I’ve got a couple of Firebird databases I need to convert. I’ve managed to connect to them using python code and the kinterbasdb library, but I can’t find a way to get a list of all the tables in the database. Is there a command that will give me the table names?
Answers:
Getting the list of tables is:
- In isql:
show tables;
- As a normal query:
SELECT a.RDB$RELATION_NAME
FROM RDB$RELATIONS a
WHERE COALESCE(RDB$SYSTEM_FLAG, 0) = 0 AND RDB$RELATION_TYPE = 0
I use:
SELECT RDB$RELATION_NAME FROM RDB$RELATIONS
WHERE (RDB$SYSTEM_FLAG <> 1 OR RDB$SYSTEM_FLAG IS NULL) AND RDB$VIEW_BLR IS NULL
ORDER BY RDB$RELATION_NAME;
So I’ve got a couple of Firebird databases I need to convert. I’ve managed to connect to them using python code and the kinterbasdb library, but I can’t find a way to get a list of all the tables in the database. Is there a command that will give me the table names?
Getting the list of tables is:
- In isql:
show tables;
- As a normal query:
SELECT a.RDB$RELATION_NAME FROM RDB$RELATIONS a WHERE COALESCE(RDB$SYSTEM_FLAG, 0) = 0 AND RDB$RELATION_TYPE = 0
I use:
SELECT RDB$RELATION_NAME FROM RDB$RELATIONS
WHERE (RDB$SYSTEM_FLAG <> 1 OR RDB$SYSTEM_FLAG IS NULL) AND RDB$VIEW_BLR IS NULL
ORDER BY RDB$RELATION_NAME;