Automic Support replied, and pointed me to the following sentence on the documentation page for
GET_VAR:
The first line is used if the parameter
Key
is not specified. Note that you must always specify the key in
static Variable objects in which the validity area "Freely selected" is
selected.
So, the answer to my question is
:
Yes, the VARA,,COLUMN syntax, omitting the Key, is valid in many cases. Whether it is valid depends on the variable being accessed.
I was unsure because the documentation page does not capture this subtlety. First, the syntax overview on the documentation page is misleading, suggesting that for the
Key and
Column either
both must be omitted, or
both must be specified. Second, the documentation page does not include any examples wherein the
key is omitted.
The syntax overview does not correctly show that the
Key and
Column are
independent of each other, and that whether or not the
key is optional depends on the type (and scope) of the variable being accessed.
GET_VAR(Variable, [Key, Column], [XPath/XQuery])
There are actually
two different syntaxes for GET_VAR:
- A syntax for readingstatic variables with the scope freely selected
Thekeyisrequired in this format.
- A syntax for reading static variables with a scope other thanfreely selected, and for reading dynamic variables.
The keyisoptional in this format.
Here is an example of how one might update the documentation to show this:
Static variables with the scope set to freely selected
GET_VAR(Variable, Key, [Column], [XPath/XQuery])
Dynamic variables & static variables with a scope other than freely selected
GET_VAR(Variable, [Key], [Column], [XPath/XQuery])
The documentation should also include an example or two that demonstrate how to use the syntax that omits the
key.
I will request that the documentation be updated.