Output SQLDA Variables

Output SQLDA variables updated by the
RLX
/SQL.
The
RLX
DESCRIBE service creates (and assigns values to) a series of REXX variables that describe a query result columns and corresponding host output variables.
  • SQLD
    This is the REXX variable into which
    RLX
    returns the number of result columns / host variables described in the SQLDA array. The remaining SQLDA variables are compound symbols referenced by a stem name and subscript value. The number of elements in the stemmed arrays associated with the SQLDA is returned as a printable integer in SQLD. Each occurrence describes a column of a Db2 result table and its corresponding host variable.
  • SQLNAME
    Each occurrence of the SQLNAME stemmed variable contains the name maintained in or assigned by Db2 for the query result column. This name may be up to 18 characters long.
  • SQLTYPE
    Each occurrence of the SQLTYPE compound variable contains the Db2 datatype of the query result column. An even value of SQLTYPE means the column does not allow nulls and an odd value means the column can assume the null value.
  • SQLNULLS
    Each occurrence of the SQLNULLS compound variable is set to 'Y' if null values are allowed for this column. Otherwise, SQLNULLS is set to 'N'.
  • SQLLEN
    Each occurrence of the SQLLEN compound variable contains the Db2 internal length of the query result column. In the case of decimal datatypes, your exec should reference the compound variables SQLPRCSN and SQLSCALE, respectively, to obtain discrete values for precision and scale.
The following list enumerates the values that may appear in the SQLTYPE and SQLLEN fields of the SQLDA. An even value of SQLTYPE means the column does not allow nulls and an odd value means the column can assume the null value.
SQLTYPE Data type of the Internal Data Type of Code Db2 Column length the Host Variable ------- ---------------- -------- --------------- 384/385 date 10 fixed-length character string representation of a date 388/389 time 8 fixed-length character string representation of a time 392/393 timestamp 26 fixed-length character string representation of a timestamp 448/449 varying-length length attribute of varying-length character string the column character string 452/453 fixed-length length attribute of fixed-length character string the column character string 456/457 long varying-length length attribute of long varying character string the column character string 460/461 N/A N/A NUL-terminated character string 464/465 varying-length length attribute of varying-length graphic string the column graphic string 468/469 fixed-length graphic length attribute of fixed length string the column graphic string 472/473 long varying-length length attribute of long graphic graphic string the column string 480/481 floating point 4 for single floating point precision, 8 for double precision 484/485 packed decimal precision value packed decimal scale value 496/497 large integer 4 large integer 500/501 small integer 2 small integer 504/505 N/A N/A DISPLAY SIGN LEADING SEPARATE 972/973 result set locator 4 result set locator