Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Reference » SQL Statements

DESCRIBE statement [ESQL] Next Page

DESCRIBE statement [Interactive SQL]


The DESCRIBE statement enables you to obtain all columns found in a table or view, all indexes found in a table, and all parameters used with a stored procedure or a function.

Syntax

DESCRIBE [ [ INDEX FOR ] TABLE | PROCEDURE ] [ owner.]object-name

Parameters

INDEX FOR    Indicates that you want to see the indexes for the specified object-name.

TABLE    Indicates that the object to be described is a table or a view.

PROCEDURE    Indicates that the object to be described is a procedure or a function.

Remarks

Use DESCRIBE TABLE to list all of the columns in the specified table or view. The DESCRIBE TABLE statement returns one row per table column. The output is formatted into four columns:

Use DESCRIBE INDEX FOR TABLE to list all of the indexes for the specified table. The DESCRIBE TABLE statement returns one row per index. The output is formatted into four columns:

Use DESCRIBE PROCEDURE to list all of the parameters used by the specified procedure or function. The DESCRIBE PROCEDURE statement returns one row for each parameter. The output is formatted into three columns:

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.

Permissions

None

Side effects

None

See also

None

Standards and compatibility
Examples

List the columns in the Departments table:

DESCRIBE TABLE Departments;

Here is an example of the result set for this statement:

ColumnTypeNullablePrimary key
DepartmentIDinteger01
DepartmentNamechar(40)00
DepartmentHeadIDinteger00

List the indexes for the Customers table:

DESCRIBE INDEX FOR TABLE Customers;

Here is an example of the results for this statement:

Index NameColumnsUnique Type
IX_customer_nameSurname,GivenName0Clustered