Name

SET DESCRIBE

Synopsis

The DESCRIBE setting controls the depth to which an object such as an object type or object table is described.

Syntax

SET DESCRIBE [DEPTH {levels | ALL}] [LINENUM {ON | OFF}] [INDENT {ON | OFF}]

Parameters

DEPTH {levels | ALL}

Specifies the depth to which to recursively describe an object. The default is to describe only the top level of columns, attributes, or parameters.

LINENUM {ON | OFF}

Adds or removes line numbers from the object's description. The default is LINENUM OFF.

INDENT {ON | OFF}

Indents nested descriptions. The default is INDENT ON.

Examples

Suppose you had the following type and table:

CREATE OR REPLACE TYPE employee_type AS (
   employee_name VARCHAR2(40),
   employee_hire_date DATE,
   employee_salary NUMBER(9,2));
/
CREATE TABLE employees AS (
   employee_id NUMBER,
   employee_data employee_type);

If you describe the table, DESCRIBE's default behavior is to list the datatype for each column in the table, but not to expand any object types:

                  DESCRIBE employees
 Name                                      Null?    Type
 ----------------------------------------- -------- ---------------
 EMPLOYEE_ID                                        NUMBER
 EMPLOYEE                                           EMPLOYEE_TYPE

If you want to know what EMPLOYEE_TYPE looks like, you must issue a second DESCRIBE command:

                  DESCRIBE employee_type
 Name                                      Null?    Type
 ----------------------------------------- -------- ---------------
 EMPLOYEE_NAME                                      VARCHAR2(40)
 EMPLOYEE_HIRE_DATE                                 DATE
 EMPLOYEE_SALARY                                    NUMBER(9,2)

The SET DESCRIBE command gives you the option of getting all this information with only one DESCRIBE command. ...

Get Oracle SQL*Plus: The Definitive Guide, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.