SQL Programming Manual for TAL
Error and Status Processing
HP NonStop SQL Programming Manual for TAL—527887-001
6-22
Example of Using the SQLDA
The compiler determines the length (820 bytes) of the names buffer (NAMEBUF) from
the parameters in the INCLUDE SQLDA directive using the formula under Declaring
the SQLDA and Names Buffer on page 6-14.
You then declare a structure for the output SQLDA:
STRUCT .osqlda (sqldax);
...
Figure 6-8. SQLDA Structure Template
LITERAL SQLDA^EYE^CATCHER = "D1";
STRUCT SQLDAX (*);
BEGIN
STRING eye^catcher[0:1];
INT num^entries;
STRUCT sqlvar[0:19];
BEGIN
INT data^type;
INT data^len;
! fields for NUMBERS:
! scale = data^len.<0:7>
! length = data^len.<8:15>
! fields for DATETIME or INTERVAL:
! qualifier = data^len.<0:7>
! length = data^len.<8:15>
INT precision;
! fields for DATETIME or INTERVAL:
! leading field precision = precision.<0:7>
! fraction precision = precision.<8:15>
INT null^info;
INT(32) var^ptr;
INT(32) ind^ptr;
FIXED reserved;
END;
END;
STRING .namebuf [0:819];
VST0608.vsd