FirebirdSQL logo

SHOW TABLEs

SHOW TABLEs [name]

This command lists all user-defined tables in the database if the first form of the command is used, or displays the columns and data types or domains of the table if the second form is used.

SQL> show tables;
COUNTRY
CUSTOMER
...

SQL> show table country;
COUNTRY                         (COUNTRYNAME) VARCHAR(15) Not Null
CURRENCY                        VARCHAR(10) Not Null
CONSTRAINT INTEG_2:
  Primary key (COUNTRY)

You will note that if there are comments defined for a table, this command will not display them.You must use the [isql-show-comments] command, but be aware that you will then be given all comments in the database.There is no command to extract the comments for a single object, unless you query the system tables directly.

SQL> comment on table country is 'This table holds details about countries.';
SQL> commit;

SQL> show comments;
...
COMMENT ON TABLE COUNTRY IS This table holds details about countries.;
...

SQL> show table country;
COUNTRY                         (COUNTRYNAME) VARCHAR(15) Not Null
CURRENCY                        VARCHAR(10) Not Null
CONSTRAINT INTEG_2:
  Primary key (COUNTRY)

SQL> select rdb$description
CON> from rdb$relations
CON> where rdb$relation_name = 'COUNTRY';

  RDB$DESCRIPTION
=================
            6:1e7
==============================================================================
RDB$DESCRIPTION:
This is a table holding details about countries.
==============================================================================

The output from the final query above is not ideal, but at least it’s much less displayed information when there are lots of comments in your database.

SHOW TRIGgers

SHOW TRIGgers [name]

This command lists all user-defined triggers in the current database.The second form of the command shows the details and source code for a specific trigger.See also the [isql-show-procedures] and [isql-show-functions] commands.

SQL> show triggers;
SET_CUST_NO; Table: CUSTOMER
SAVE_SALARY_CHANGE; Table: EMPLOYEE
SET_EMP_NO; Table: EMPLOYEE
POST_NEW_ORDER; Table: SALES

SQL> show trigger set_cust_no;

Triggers on Table CUSTOMER:
SET_CUST_NO, Sequence: 0, Type: BEFORE INSERT, Active
Trigger text:
=============================================================================
AS
BEGIN
    if (new.cust_no is null) then
    new.cust_no = gen_id(cust_no_gen, 1);
END
=============================================================================

SHOW VERsion

SHOW VERsion

This command displays details about the Firebird software, your database and the on-disk structure (ODS) in use.

SQL> show version;
ISQL Version: WI-V5.0.0.1306 Firebird 5.0
Server version:
Firebird/Windows/AMD/Intel/x64 (access method), version "WI-V5.0.0.1306 Firebird 5.0"
on disk structure version 13.1

Depending on the connection protocol, the output may include multiple version lines.The example above is an embedded connection, so only the database engine information is shown.

SHOW USERS

SHOW USERS

This command shows a list of users in the security database, and the number of connections they have to the current database.

Note

Older versions of isql show only connected users, and will report each connection separately.

SQL> show users;
Users in the database
  1  NORMAN
  8 #SYSDBA

Only users with administrator privileges will be able to see information on other users.