SQL/MP Reference Manual
HP NonStop SQL/MP Reference Manual—523352-013
D-42
DESCRIBE INPUT Statement
NAMES INTO :names-buffer
specifies the host variable name of a names buffer declared in an INCLUDE
SQLDA statement or elsewhere in your program into which DESCRIBE returns the
names of the input parameters.
If you specify the NAMES INTO clause, DESCRIBE INPUT sets the VAR_PTR
field for each entry in the SQLDA to the address of the corresponding entry in the
names buffer.
Each entry in the names buffer is in VARCHAR format: the entry begins with a
2-byte numeric prefix that contains the length of the name; the SQL identifier that is
the name itself follows. (The question mark that precedes a parameter name in an
SQL statement is not included in the name.) Unnamed parameters have a length
of 0. If the name has an odd number of characters, it is followed by a blank to
make it an even length. If a SELECT column is a constant or expression, the name
entry has a length of 0. The table name could be the actual table name itself, a
user specified correlation name, or a DEFINE name for the table (without the
leading = sign). The precedence is: correlation name first, define name second,
and the actual table name the last. For example:
Example 1:
STATEMENT
SELECT C1 FROM TABLE1 WHERE C1 > 100;
NAMES-BUFFER (OUTPUT)
{09}TABLE1.C1
Example 2:
STATEMENT
SELECT C1 FROM TABLE1 T1 WHERE T1.C1 > 100;
NAMES-BUFFER (OUTPUT)
{05}T1.C1
Example 3:
STATEMENT
SELECT C1 FROM =TABLE_NAME_1 WHERE C1 > 100;
NAMES-BUFFER (OUTPUT)
{15}TABLE_NAME_1.C1
Example 4:
STATEMENT
SELECT C1 FROM =TABLE_NAME_1 T1 WHERE T1.C1 > 100;
NAMES-BUFFER (OUTPUT)
{05}T1.C1
If your program uses indicator parameters to handle null values, DESCRIBE
INPUT also returns the names of the indicator parameters to the names buffer. The