|Oracle9i Supplied PL/SQL Packages and Types Reference
Release 1 (9.0.1)
Part Number A89852-02
DBMS_SQL , 15 of 20
This procedure describes the columns for a cursor opened and parsed through
DBMS_SQL package declares the
DESC_REC record type as follows:
type desc_rec is record ( col_type BINARY_INTEGER := 0, col_max_len BINARY_INTEGER := 0, col_name VARCHAR2(32) := '', col_name_len BINARY_INTEGER := 0, col_schema_name VARCHAR2(32) := '', col_schema_name_len BINARY_INTEGER := 0, col_precision BINARY_INTEGER := 0, col_scale BINARY_INTEGER := 0, col_charsetid BINARY_INTEGER := 0, col_charsetform BINARY_INTEGER := 0, col_null_ok BOOLEAN := TRUE);
Type of the column being described.
Maximum length of the column.
Name of the column.
Length of the column name.
Name of the schema the column type was defined in, if an object type.
Length of the schema.
Column precision, if a number.
Column scale, if a number.
Column character set identifier.
Column character set form.
True if column can be null.
DESC_TAB type is a PL/SQL table of
You can declare a local variable as the PL/SQL table type
DESC_TAB, and then call the
DESCRIBE_COLUMNS procedure to fill in the table with the description of each column. All columns are described; you cannot describe a single column.
ID number of the cursor for the columns being described.
Number of columns in the select list of the query.
DESC_RECdescribing a column in the query.
"Example 8: Describe Columns" illustrates how to use