id="sqlvaroc">Field descriptions in an occurrence of SQLVAR

 

Fields in an occurrence of a base SQLVAR

 

Table 97. Field Descriptions for an SQLVAR
C Name 108
COBOL Name
PL/I Name
RPG Name
Field
Data Type
Usage in DESCRIBE and PREPARE (set by the database manager) Usage in FETCH, OPEN, CALL, and EXECUTE (set by the user prior to executing the statement)
sqltype
SQLTYPE
SMALLINT Indicates the data type of the column and whether it can contain nulls. For a description of the type codes, see Table 99.

For a distinct type, the data type on which the distinct type is based is placed in this field. The base SQLVAR contains no indication that this is part of the description of a distinct type.

Indicates the data type of the host variable and whether an indicator variable is provided. For a description of the type codes, see Table 99.
sqllen
SQLLEN
SMALLINT The length attribute of the column. For datetime columns, the length of the string representation of the values. See Table 99.

For a LOB, the value is 0 regardless of the length attribute of the LOB. Field SQLLONGLEN in the extended SQLVAR entry contains the length attribute of the LOB.

The length attribute of the host variable. See Table 99.

For a LOB, the value is 0 regardless of the length attribute of the LOB. Field SQLLONGLEN in the extended SQLVAR entry contains the length attribute of the LOB.

sqlres
SQLRES
CHAR(12) Reserved. Provides boundary alignment for SQLDATA. Reserved. Provides boundary alignment for SQLDATA.
sqldata
SQLDATA
pointer The CCSID of a string column as described in Table 100. Contains the address of the host variable.

For LOB host variables, if the SQLDATALEN field in the extended SQLVAR is null, this points to the four-byte LOB length, followed immediately by the LOB data.

If the SQLDATALEN field in the extended SQLVAR is not null, this points to the LOB data and the SQLDATALEN field points to the four-byte LOB length.

sqlind
SQLIND
pointer Reserved Contains the address of the indicator variable. Not used if there is no indicator variable (as indicated by an even value of SQLTYPE).
sqlname
SQLNAME
VARCHAR(30) The unqualified name of the column. If the column does not have a name, a string is constructed from the expression and returned.

The name is case sensitive and does not contain surrounding delimiters.

Contains the CCSID of the host variable as described in Table 100.

 

Fields in an occurrence of a secondary SQLVAR

 

Table 98. Field Descriptions for an Extended SQLVAR
C Name 109
COBOL Name
PL/I Name
RPG Name
Field
Data Type
Usage in DESCRIBE and PREPARE (set by the database manager) Usage in FETCH, OPEN, CALL, and EXECUTE (set by the user prior to executing the statement)
len.sqllonglen
SQLLONGL
SQLLONGLEN
INTEGER The length attribute of a LOB column. The length attribute of a LOB host variable. The database manager ignores the SQLLEN field in the base SQLVAR for these data types. The length attribute indicates the number of bytes for a BLOB or CLOB, and the number of characters for a DBCLOB.
* CHAR(12) Reserved. Provides boundary alignment for SQLDATALEN. Reserved. Provides boundary alignment for SQLDATALEN.
* pointer Reserved. Reserved.
sqldatalen
SQLDATAL
SQLDATALEN
pointer Not used. Used only for LOB host variables.

If the value of this field is not null, this field points to a four-byte long buffer that contains the actual length of the LOB in bytes (even for DBCLOBs). The SQLDATA field in the matching base SQLVAR then points to the LOB data.

If the value of this field is null, the actual length of the LOB is stored in the first four bytes pointed to by the SQLDATA field in the matching base SQLVAR, and the LOB data immediately follows the four-byte length. The actual length indicates the number of bytes for a BLOB or CLOB and the number of double-byte characters for a DBCLOB.

Regardless of whether this field is used, field SQLLONGLEN must be set.

sqldatatype_name
SQLTNAME
SQLDATATYPE-NAME
VARCHAR (30) The SQLTNAME field of the extended SQLVAR is set to one of the following:

  • For a distinct type column, the database manager sets this to the fully qualified distinct type name. If the qualified name is longer than 30 bytes, it is truncated.

  • For a label, the database manager sets this to the first 20 bytes of the label.

  • For a column name, the database manager sets this to the column name.
Not used.

108. In this column, the lowercase name is the C Name. The uppercase name is the PL/I, COBOL, and RPG Name.109. In this column, the lowercase name is the C Name. The first uppercase name is the PL/I and RPG Name. The second uppercase name is the COBOL Name.


[ Top of Page | Previous Page | Next Page | Contents |
Index ]