EasyManua.ls Logo

Sybase Adaptive Server Anywhere - Page 520

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...
DESCRIBE statement [ESQL]
502
OUTPUT The DESCRIBE OUTPUT statement fills in the data type and
length for each select list item in the SQLDA. The name field is also filled in
with a name for the select list item. If an alias is specified for a select list
item, the name will be that alias. Otherwise, the name will be derived from
the select list item: if the item is a simple column name, it will be used;
otherwise, a substring of the expression will be used. DESCRIBE will also
put the number of select list items in the sqld field of the SQLDA.
If the statement being described is a UNION of two or more SELECT
statements, the column names returned for DESCRIBE OUTPUT are the
same column names which would be returned for the first SELECT
statement.
If you describe a CALL statement, the DESCRIBE OUTPUT statement fills
in the data type, length, and name in the SQLDA for each INOUT or OUT
parameter in the procedure. DESCRIBE OUTPUT also puts the number of
INOUT or OUT parameters in the sqld field of the SQLDA.
If you describe a CALL statement with a result set, the DESCRIBE
OUTPUT statement fills in the data type, length, and name in the SQLDA
for each RESULT column in the procedure definition. DESCRIBE OUTPUT
will also put the number of result columns in the sqld field of the SQLDA.
LONG NAMES The LONG NAMES clause is provided to retrieve column
names for a statement or cursor. Without this clause, there is a 29-character
limit on the length of column names; with the clause, names of an arbitrary
length are supported.
If LONG NAMES is used, the long names are placed into the SQLDATA
field of the SQLDA, as if you were fetching from a cursor. None of the other
fields (SQLLEN, SQLTYPE, and so on) are filled in. The SQLDA must be
set up like a FETCH SQLDA: it must contain one entry for each column, and
the entry must be a string type. If there is an indicator variable, truncation is
indicated in the usual fashion.
The default specification for the long names is TABLE.COLUMN.
WITH VARIABLE RESULT This clause is used to describe procedures
that may have more than one result set, with different numbers or types of
columns.
If WITH VARIABLE RESULT is used, the database server sets the
SQLCOUNT value after the DESCRIBE statement to one of the following
values:
0 The result set may change. The procedure call should be described
again following each OPEN statement.
1 The result set is fixed. No redescribing is required.

Table of Contents

Related product manuals