SQL Programming Manual for TAL

Dynamic NonStop SQL Operations
HP NonStop SQL Programming Manual for TAL527887-001
7-30
Allocating and Filling in Output Variables
Figure 7-5. Displaying Output (page 2 of 3)
_SQLDT_16BIT_U ->
PUT^DBL^MID ($UDBL(param^.v^smallint) );
_SQLDT_16BIT_S -> -- handle sign for smallint signed:
IF param^.v^smallint >= 0 THEN
BEGIN
PUT^INT^MID (param^.v^smallint);
END
ELSE
BEGIN
PUT^STR^MID("-");
PUT^INT^MID(-param^.v^smallint);
END;
CASE osqlda^ptr.sqlvar[i].data^type OF
BEGIN
_SQLDT_ASCII_F,
_SQLDT_ASCII_F_UP -> -- display first 38 characters:
PUT^STR^MID (param^.v^char for $MIN(38,datalen);
-- If you want to display the column names once (as SQLCI
-- does), rather than repetitively with each FETCH,
-- display all the names at this point. The remaining
-- code here assumes a repetitive display of column names
-- and their associated values.
-- Position onamesbuf^ptr to the length prefix in
-- the names buffer, save the length, move
-- the pointer past the prefix and onto a name, and save
-- the column name. Code is the same as that used for
-- input parameter names (see "Getting Parameter Values").
FOR i := 0 to (output^num - 1) DO
BEGIN
@param^ := osqlda^ptr.sqlvar[i].var^ptr;
datalen := osqlda^ptr.sqlvar[i].data^len;
VST0705.vsd