SQL*Plus User's Guide and Reference

Contents Index Home Previous Next

DESCRIBE

Purpose

Lists the column definitions for the specified table, view, or synonym or the specifications for the specified function or procedure.

Syntax

DESC[RIBE] {[user.]table[@database_link_name] [column]| [user.]object[.subobject]}

Terms and Clauses

Refer to the following list for a description of each term or clause:

user Represents the user who owns table or object. If you omit user, SQL*Plus assumes you own table or object.
table Represents the table, view, or synonym you wish to describe.
database_link_name Consists of the database link name corresponding to the database where table exists. For more information on which privileges allow access to another table in a different schema, refer to the Oracle7 Server SQL Language Reference Manual.
column Represents the column in table you wish to describe.
object Represents the function or procedure you wish to describe. If you want to describe a procedure that is in a package, object is the name of the package.
subobject Represents the function or procedure in a package you wish to describe.
Usage Notes

The description for tables, views, and synonyms contains the following information:

When you do a DESCRIBE, VARCHAR columns are returned with a type of VARCHAR2.

The description for functions and procedures contains the following information:

Example

To describe the table EMP, enter

SQL> DESCRIBE EMP

DESCRIBE lists the following information:

Name                           Null?    Type
------------------------------ -------- ------------
EMPNO                          NOT NULL NUMBER(4)
ENAME                                   CHAR(10)
JOB                                     JOB(9)
MGR                                     NUMBER(4)
HIREDATE                                DATE
SAL                                     NUMBER(7,2)
COMM                                    NUMBER(7,2)
DEPTNO                                  NUMBER(2)

To describe a procedure called CUSTOMER_LOOKUP, enter

SQL> DESCRIBE customer_lookup

DESCRIBE lists the following information:

PROCEDURE customer_lookup
Argument Name          Type     In/Out   Default?
---------------------- -------- -------- ---------
CUST_ID                NUMBER   IN
CUST_NAME              VARCHAR2 OUT

To describe the procedure APROC in the package APACK, enter

SQL> DESCRIBE apack.aproc

DESCRIBE lists the following information:

PROCEDURE apack.aproc
Argument Name          Type     In/Out   Default?
---------------------- -------- -------- ---------
P1                     CHAR     IN
P2                     NUMBER   IN


Contents Index Home Previous Next