2009/07/29

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;

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

沒有留言:

張貼留言

JSON Parse in Delphi XE (01)

在 Delphi.ktop 的主題中,看到了【 JSON求教 】這一篇 如果在 XE 裡面要實現,是不是也是這麼簡單? 想到了,就開始來實作吧!