initializes the descriptor to hold information about the input variables for the SQL statement or PL/SQL block.
SELECT LIST
initializes the descriptor to hold information about the select list of a SELECT statement.
The default is SELECT LIST FOR.
statement_name block_name
identifies a SQL statement or PL/SQL block previously prepared with a PREPARE statement.
descriptor
is the name of the descriptor to be initialized.
You cannot describe both input variables and output variables into the same descriptor.
The number of variables found by a DESCRIBE statement is the total number of placeholders in the prepare SQL statement or PL/SQL block, rather than the total number of uniquely named placeholders. For more information on this command, see Programmer's Guide to the Oracle Precompilers.
Example
This example illustrates the use of the DESCRIBE statement in a Pro*C embedded SQL program:
EXEC SQL PREPARE my_statement FROM :my_string;
EXEC SQL DECLARE emp_cursor
FOR SELECT empno, ename, sal, comm
FROM emp
WHERE deptno = :dept_number
EXEC SQL DESCRIBE BIND VARIABLES FOR my_statement
INTO bind_descriptor;
EXEC SQL OPEN emp_cursor
USING bind_descriptor;
EXEC SQL DESCRIBE SELECT LIST FOR my_statement
INTO select_descriptor;
EXEC SQL FETCH emp_cursor
INTO select_descriptor;