You request information about database objects [External] of a database instance.
You have logged on to a database instance [Page 4]
...
Enter one of the SQLCLI commands listed below.
SQLCLI returns information about the database objects that correspond to the specified pattern [PATTERN] or [NAME] and to which you have access. If you do not specify a pattern, the system displays information about all the database objects to which you have access.
SQLCLI commands for requesting information about the database catalog
Database Object |
SQLCLI Command |
Result |
column |
\dc [PATTERN] |
· Column name · Data type · Column length · Null value permitted or not · Position of column in primary key of table (if applicable) |
index |
\de [PATTERN] |
· Index name · Columns contained in index · Position of column in index · Specifies whether index is UNIQUE · Sorting |
database procedure |
\dp [PATTERN] |
· Schema name · Name of database procedure · Package to which database procedure is assigned |
table |
\dt [PATTERN] |
· Schema name · Table name · Table type |
Database user |
\du [NAME] |
· Name of database user |
View |
\dv [PATTERN] |
· Schema name · View name |
The following syntax applies to the pattern [PATTERN]:
PATTERN |
[OWNER.][OBJECT_NAME] or [SCHEMA.][OBJECT_NAME] |
OWNER |
Owner of database object for which information is to be requested |
SCHEMA |
Schema of database object for which information is to be requested |
OBJECT_NAME |
Name of database object |
You can use the following placeholders:
· For one character: _
· For any number of characters: %
Displaying information for the columns in the CUSTOMER table that belongs to the user MONA:
\dc MONA.CUSTOMER
Table
"MONA.CUSTOMER"
Column Name | Type | Length |
Nullable | KEYPOS
------------+------------+--------+----------+-------
ADDRESS | CHAR
ASCII | 25 |
NO
|
CNO |
FIXED |
4 |
NO |
1
FIRSTNAME | CHAR ASCII |
10 | YES |
NAME
| CHAR ASCII | 10 | NO |
TITLE
| CHAR ASCII | 7 | YES |
ZIP
| CHAR ASCII | 5 | YES |
(6 rows selected)