EasyManua.ls Logo

Sybase Adaptive Server Anywhere - Page 519

Sybase Adaptive Server Anywhere
1182 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 9 SQL Statements
501
If you specify a cursor name, the cursor must have been previously declared
and opened. The default action is to describe the OUTPUT. Only SELECT
statements and CALL statements have OUTPUT. A DESCRIBE OUTPUT
on any other statement, or on a cursor that is not a dynamic cursor, indicates
no output by setting the sqld field of the SQLDA to zero.
USER TYPES A DESCRIBE statement with the USER TYPES clause
returns information about domains of a column. Typically, such a
DESCRIBE will be done when a previous DESCRIBE returns an indicator of
DT_HAS_USERTYPE_INFO.
The information returned is the same as for a DESCRIBE without the USER
TYPES keywords, except that the sqlname field holds the name of the
domain, instead of the name of the column.
If the DESCRIBE uses the LONG NAMES clause, the sqldata field holds
this information.
ALL DESCRIBE ALL allows you to describe INPUT and OUTPUT with
one request to the database server. This has a performance benefit. The
INPUT information will be filled in the SQLDA first, followed by the
OUTPUT information. The sqld field contains the total number of INPUT
and OUTPUT variables. The DT_DESCRIBE_INPUT bit in the indicator
variable is set for INPUT variables and clear for OUTPUT variables.
INPUT A bind variable is a value supplied by the application when the
database executes the statements. Bind variables can be considered
parameters to the statement. DESCRIBE INPUT fills in the name fields in
the SQLDA with the bind variable names. DESCRIBE INPUT also puts the
number of bind variables in the sqld field of the SQLDA.
DESCRIBE uses the indicator variables in the SQLDA to provide additional
information. DT_PROCEDURE_IN and DT_PROCEDURE_OUT are bits
that are set in the indicator variable when a CALL statement is described.
DT_PROCEDURE_IN indicates an IN or INOUT parameter and
DT_PROCEDURE_OUT indicates an INOUT or OUT parameter. Procedure
RESULT columns will have both bits clear. After a describe OUTPUT, these
bits can be used to distinguish between statements that have result sets (need
to use OPEN, FETCH, RESUME, CLOSE) and statements that do not (need
to use EXECUTE). DESCRIBE INPUT only sets DT_PROCEDURE_IN
and DT_PROCEDURE_OUT appropriately when a bind variable is an
argument to a CALL statement; bind variables within an expression that is an
argument in a CALL statement will not set the bits.
Parameters

Table of Contents

Related product manuals