SQL/MP Programming Manual for COBOL

Dynamic SQL Operations
HP NonStop SQL/MP Programming Manual for COBOL529758-003
10-27
Prompting the User for Input Values
You can use VAR-PTR to read the names from the names buffer only if you access the
names buffer immediately following DESCRIBE INPUT or DESCRIBE. After you have
set VAR-PTR to point to the data, you can no longer use VAR-PTR to access the
names buffer and must loop through the names buffer to get the names.
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|
When reading the names buffer, check to see if NULL-INFO is -1. If so, read the length
field for the indicator and add this length field to the index to skip to the next name in
the names buffer.
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