SQLIMSTYPE and SQLIMSLEN

The contents of the SQLIMSTYPE and SQLIMSLEN fields of the SQLIMSDA depends on the SQL statement that is returning the value.

The following table shows the values that can appear in the SQLIMSTYPE and SQLIMSLEN fields of the SQLIMSDA. In DESCRIBE, an even value of SQLIMSTYPE means the column does not allow nulls, and an odd value means the column does allow nulls. In FETCH, an even value of SQLIMSTYPE means no indicator variable is provided, and an odd value means that SQLIMSIND contains the address of an indicator variable.

Table 1. SQLIMSTYPE and SQLIMSLEN values for DESCRIBE, FETCH, OPEN, and EXECUTE
SQLIMSTYPE For DESCRIBE For FETCH
Column or parameter data type SQLIMSLEN Host variable data type SQLIMSLEN
384/385 date 10 1 fixed-length character string representation of a date length attribute of the host variable
388/389 time 2 fixed-length character string representation of a time length attribute of the host variable
392/393 timestamp 26 fixed-length character string representation of a timestamp length attribute of the host variable
452/453 fixed-length character string length attribute of the column fixed-length character string length attribute of the host variable
480/481 floating point

4 for single precision,
8 for double precision

floating point

4 for single precision,
8 for double precision

484/485 packed decimal precision in byte 1; scale in byte 2 packed decimal precision in byte 1; scale in byte 2
492/493 big integer4 8 big integer 8
496/497 large integer 4 large integer 4
500/501 small integer 2 small integer 2
504/505 N/A N/A

DISPLAY SIGN
LEADING SEPARATE,
NATIONAL SIGN
LEADING SEPARATE

precision in byte 1; scale in byte 2
912/913 fixed-length binary string length attribute of the column fixed-length binary string length attribute of the host variable
Note:
  1. SQLIMSLEN might be different if a date installation exit is specified.
  2. SQLIMSLEN might be different if a time installation exit is specified.
  3. Field SQLIMSLONGLEN in the extended SQLIMSVAR contains the length attribute of the column.
  4. BIGINT is supported by other IMS platforms.