Translate

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;

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

沒有留言:

張貼留言

一山不容二虎之 EDBClient - Key violation 記事

關聯式資料庫裡有個很基本的特性:PRIMARY KEY 條件約束。 一個資料表只能有一個 PRIMARY KEY 條件約束,並且任何加入 PRIMARY KEY 條件約束的資料行都不可接受 Null 值。因為 PRIMARY KEY 條件約束保證唯一的資料,它們通常...