Returns information about a given database object.
DESCRIBE [ [ INDEX FOR ] TABLE | PROCEDURE ] [ owner.]object-name
object-name : table | view | materialized view | procedure | function
DESCRIBE CONNECTION
Indicates that you want to see the indexes for the specified object-name.
Indicates that object-name to be described is a table or a view.
Indicates that object-name is a procedure or a function.
Use DESCRIBE TABLE to list all the columns in the specified table or view. The DESCRIBE TABLE statement returns one row per table column, containing:
The name of the column.
The type of data in the column.
Whether nulls are allowed (1=yes, 0=no).
Whether the column is in the primary key (1=yes, 0=no).
Use DESCRIBE INDEX FOR TABLE to list all the indexes for the specified table. The DESCRIBE TABLE statement returns one row per index, containing:
The name of the index.
The columns in the index.
Whether the index is unique (1=yes, 0=no).
The type of index. Possible values are: Clustered, Statistic, Hashed, and Other.
Use DESCRIBE PROCEDURE to list all the parameters used by the specified procedure or function. The DESCRIBE PROCEDURE statement returns one row for each parameter, containing:
The name of the parameter.
The data type of the parameter.
Information about what is passed to, or returned from, the parameter. Possible values are:
The parameter is passed to the procedure, but is not modified.
The procedure ignores the parameter's initial value and sets its value when the procedure returns.
The parameter is passed to the procedure and the procedure sets the parameter's value when the procedure returns.
The parameter returns a result set.
The parameter returns a declared return value.
When using DESCRIBE PROCEDURE, the returned parameter list is retrieved from the SYSPROCPARM system view.
If you do not specify either TABLE or PROCEDURE (for example, DESCRIBE object-name), Interactive SQL assumes the object is a table. However, if no such table exists, Interactive SQL attempts to describe the object as either a procedure or a function.
Use the DESCRIBE statement to list information about the database or database server that Interactive SQL is connected to. The following properties are returned:
The name and version number of the database product Interactive SQL is connected to (for example, SQL Anywhere 17.0.4.1691).
The network name of the computer the database server is running on.
The IP address of the computer the database server is running on.
The name and version number of the operating system used by the computer the database server is running on.
The name of the database server.
The port number used by the database server for the current connection.
The name of the database that Interactive SQL is connected to.
The character set used for CHAR columns in the database.
The connection string that was used to connect to the database or database server. Three asterisks replace passwords.
Properties that do not apply to the current connection are omitted. For example, if you connect to a database server using shared memory, then the TCP/IP port is omitted.
None
None
Not in the standard.
Describe the columns in the Departments table:
DESCRIBE TABLE GROUPO.Departments;
Here is an example of the result set for this statement:
Column | Type | Nullable | Primary key |
---|---|---|---|
DepartmentID | integer | 0 | 1 |
DepartmentName | char(40) | 0 | 0 |
DepartmentHeadID | integer | 1 | 0 |
List the indexes for the Customers table:
DESCRIBE INDEX FOR TABLE GROUPO.Customers;
Here is an example of the results for this statement:
Index Name | Columns | Unique | Type |
---|---|---|---|
IX_customer_name | Surname,GivenName | 0 | Clustered |