NonStop SQL/MP Reference Manual

Table Of Contents
NonStop SQL/MP Reference Manual142115
D-43
Examples—DESCRIBE
COLLATIONS INTO :collations-buffer
specifies the name of a collations buffer declared in an INCLUDE SQLDA
statement or elsewhere in your program into which DESCRIBE returns collations
associated with the SELECT columns.
If you specify the COLLATIONS INTO clause, DESCRIBE sets the CPRL_PTR
item for each entry in the SQLDA to the address of the corresponding entry in the
collations buffer.
Each entry in the collation buffer is in VARCHAR format: the entry begins with a 2-
byte numeric prefix that contains the length of the collation; the collation follows.
To compare collations associated with different objects, use the Guardian procedures
described in the NonStop SQL/MP programming manual for your host language.
Examples—DESCRIBE
The following COBOL85 statement returns descriptions of output variables in the
prepared statement identified by S1 to the SQLDA identified by :OUT-SQLDA:
EXEC SQL DESCRIBE S1 INTO :OUT-SQLDA
NAMES INTO :OUT-NAMESBUF
COLLATIONS INTO :OUT-COLLBUF END-EXEC.
The NAMES INTO and COLLATIONS INTO clauses direct DESCRIBE to return
the names of the output variables and any collations associated with the output
variables to buffers reserved for them. DESCRIBE sets the VAR-PTR and CPRL-
PTR fields of each entry in the SQLDA to the addresses of the corresponding name
and collation.
For examples of related statements and a detailed discussion of dynamic SQL
programming techniques, see the NonStop SQL/MP Programming Manual for C or
the NonStop SQL/MP Programming Manual for COBOL85.
Detail Alias
A detail alias is a name assigned to a print item using the NAME clause of the DETAIL
command. You can use a detail alias to refer to the print item in report formatting
commands such as TOTAL and SUBTOTAL, but not within the DETAIL command
itself.
A detail alias is not the same as an alias, which is a name assigned to a column in the
select list of the SELECT command using the report writer NAME command. You can
use an alias (but not a detail alias) to refer to a column in any part of the report
definition.
DETAIL Command
DETAIL is an SQLCI report writer command that defines the contents and format of a
detail line. (A detail line is the output from a single row returned by a SELECT