Firebird的Show Tables?那是MySQL的指令啦!

出處:FAQ for Firebird Users Migrating From MySQL

原文如下:

How to list all tables in a database?

In MySQL, you can do SHOW TABLES. You can use the same in Firebird's isql command-line tool, but nowhere else. However, this can be done by querying Firebird's system tables:

SELECT RDB$RELATION_NAME FROM RDB$RELATIONS;

This query will show you both system and user tables. To select user tables only, use this:

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

Note for advanced users:
The above query will select both user tables and views. To select tables only use this:

SELECT RDB$RELATION_NAME FROM RDB$RELATIONS WHERE RDB$SYSTEM_FLAG = 0 AND RDB$VIEW_BLR IS NULL;

有看不懂的…再寫個意見給我吧。

留言

這個網誌中的熱門文章

對於 Delphi 10.1 Berlin 推出的看法

Delphi ORM Generator