SQL Programming Manual for TAL
Error and Status Processing
HP NonStop SQL Programming Manual for TAL—527887-001
6-16
Declaring the SQLDA and Names Buffer
The SQL compiler determines length in bytes for the names buffer using this formula:
length = ( name-string-size + 11 ) * sqlvar-count
The compiler derives the 11 bytes added to the name-string-size from the:
Table 6-4
describes each field in the SQLDA.
Figure 6-7. Release C10 SQLDA Template and Names Buffer
length field 2 bytes
table name 8 bytes
separator ( – ) 1 byte
LITERAL SQLDA^EYE^CATCHER^R1 = "DA";
STRUCT sqlda-name (*) ;
BEGIN
STRING eye^catcher[0:1];
INT num^entries;
STRUCT sqlvar[0: sqlvar-count - 1 ];
BEGIN
INT data^type;
INT data^len;
! fields for NUMBERS:
! scale = data^len.<0:7>
! length = data^len.<8:15>
INT null^info;
INT(32) var^ptr;
INT(32) reserved;
END;
END;
STRING . names-buffer-name[ 0 : length - 1 ];
VST0607.vsd