SQL Programming Manual for Pascal

Using Dynamic SQL
HP NonStop SQL Programming Manual for Pascal528614-001
7-28
Using the Names Buffer
might want to check for this blank padding. Expressions appear as a null string with a
length of 0.
For the program to determine the names in the names buffer, you can write a routine to
return the VARCHAR structure for a name when given the index of the parameter
information desired. After the DESCRIBE INPUT statement executes, the information
for each parameter is in the SQLVAR array; the VAR_PTR field contains the address of
the length field for each parameter name in the names buffer.
Some examples of entries in the names buffer are:
A complete names buffer with the names shown in this example might look like this:
|04|ABCD|06|ABCDE |00|
To prompt the user with the parameter names in the input names buffer, you must read
the length of the name and then position a pointer past the length field and onto the
name. Figure 7-8 on page 7-29 shows code to use the names buffer, prompt for input,
and read parameter values input by the user.
Complete Entry Entry Part Description
|04|ABCD| |04|
|ABCD|
2-byte length 4-character string with value = 4
4-character string
|06|ABCDE | |06|
|ABCDE |
2-byte length 4-character string with value = 6
5-character string padded with 1 trailing blank
|00| | |00|
| |
2-byte length with value = 0
Null string