NET/MASTER Network Control Language (NCL) Reference Manual

VARTABLE QUERY
Verbs
106126 Tandem Computers Incorporated 3–215
VARS=
output-vars-list
specifies the NCL variables that receive the information for each entry in
fieldlist
. There is a one-to-one correspondence from each entry in
output-vars-list
to the same entry in
fieldlist
. The first entry in
output-vars-list
specifies the variable containing the data for the first entry
in
fieldlist
.
Considerations
The &SYS.FDBK system variable is set after a VARTABLE QUERY statement,
indicating one of the following results:
Return
Code
Description
0 A table with the supplied name was found in the requested scope. Information
variables are set if requested.
16 No table of this name exists in this scope.
FIELDS and VARS operands enable you to specify the information you wish to
retrieve about the table and the NCL variables that the information is to be placed
in. You must specify both of these parameters or omit both. If specified, the two
parameters must have the same number of entries in their lists.
An NCL process can determine if a cached copy of a global vartable exists by
issuing a query on a VARTABLE with SCOPE=CACHED. If no VARTABLE GET
SCOPE=CACHED has been issued in this process, the query fails and the value 16
is returned in &SYS.FDBK system variable. See the example shown later.
For more information on VARTABLE verbs, refer to the NonStop NET/MASTER
NCL Programmer's Guide.
Examples
The following example queries the existence of a table called MYTABLE in the current
NCL procedure environment. The &SYS.FDBK system variable is set as a result:
VARTABLE QUERY ID=MYTABLE
The following example queries the existence of a table called GTABLE that is cached in
scope:
VARTABLE QUERY ID=GTABLE SCOPE=CACHED FIELDS=(TOTAL,KEYLEN),
VARS=(&T,&K)
If found, the key length and current number of entries are returned in NCL variables
&T and &K, respectively. If no VARTABLE GET SCOPE=CACHED has been issued in
this process, the query fails and the value 16 is returned in &SYS.FDBK system
variable.