SQLTYPE and SQLLEN

The following table shows the values that may appear in the SQLTYPE and SQLLEN fields of the SQLDA. In PREPARE and DESCRIBE, an even value of SQLTYPE means the column does not allow nulls, and an odd value means the column does allow nulls.

In an SQLDA used in DESCRIBE or PREPARE statements, an odd value is returned for an expression if one operand is nullable or if the expression may result in a -2 mapping-error null value.

In FETCH, OPEN, CALL, and EXECUTE, an even value of SQLTYPE means no indicator variable is provided, and an odd value means that SQLIND contains the address of an indicator variable.

Table 99. SQLTYPE and SQLLEN values for PREPARE, DESCRIBE, FETCH, OPEN, CALL, or EXECUTE
SQLTYPE For PREPARE and DESCRIBE For FETCH, OPEN, CALL, and EXECUTE
COLUMN DATA TYPE SQLLEN HOST VARIABLE DATA TYPE SQLLEN
384/385 Date 110 10 Fixed-length character-string representation of a date Length attribute of the host variable
388/389 Time 8 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 time stamp Length attribute of the host variable
396/397 DataLink Length attribute of the column DataLink Length attribute of the host variable
400/401 Not Applicable Not Applicable NUL-terminated graphic string Length attribute of the host variable
404/405 BLOB 0 111 BLOB Not used. 111
408/409 CLOB 0 111 CLOB Not used. 111
412/413 DBCLOB 0 111 DBCLOB Not used. 111
448/449 Varying-length character string Length attribute of the column Varying-length character string 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
456/457 Long varying-length character string Length attribute of the column Long varying-length character string Length attribute of the host variable
460/461 Not Applicable Not Applicable NUL-terminated character string Length attribute of the host variable
464/465 Varying-length graphic string Length attribute of the column Varying-length graphic string Length attribute of the host variable
468/469 Fixed-length graphic string Length attribute of the column Fixed-length graphic string Length attribute of the host variable
472/473 Long varying-length graphic string Length attribute of the column Long graphic string Length attribute of the host variable
476/477 Not Applicable Not Applicable PASCAL L-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
488/489 Zoned decimal Precision in byte 1; scale in byte 2 Zoned decimal Precision in byte 1; scale in byte 2
492/493 Big integer 8 112 Big integer 8
496/497 Large integer 4 112 Large integer 4
500/501 Small integer 2 112 Small integer 2
504/505 Not Applicable Not Applicable DISPLAY SIGN LEADING SEPARATE Precision in byte 1; scale in byte 2
904/905 ROWID 40 ROWID 40
908/909 Varying-length binary string Length attribute of the column Varying-length binary string Length attribute of the host variable
912/913 Fixed-length binary string Length attribute of the column Fixed-length binary string Length attribute of the host variable
916/917 Not Applicable Not Applicable BLOB file reference variable 267
920/921 Not Applicable Not Applicable CLOB file reference variable 267
924/925 Not Applicable Not Applicable DBCLOB file reference variable 267
960/961 Not Applicable Not Applicable BLOB locator 4
964/965 Not Applicable Not Applicable CLOB locator 4
968/969 Not Applicable Not Applicable DBCLOB locator 4

110. Less for *JUL, *YMD, *DMY, and *MDY formats. For more information, see Table 5111. Field SQLLONGLEN in the extended SQLVAR contains the length attribute of the column.112. Binary numbers can be represented in the SQLDA with a length of 2, 4, or 8, or with the precision in byte 1 and the scale in byte 2. If the first byte is greater than x'00', it indicates precision and scale.


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