Passing Delimited Identifiers
Suppose the value in the valuestring is a delimited identifier. For example, you want a list of employees with some other information about each employee that is to be determined at runtime by entering a column name.
To accomplish this, your report code looks like this:
.declare info = varchar (20)
.query select firstname, lastname, $info as otherinfo
from emp
The information you want to select from the database is in a column whose name is a delimited identifier.
To specify the delimited identifier as a value on the command line, you must:
1. Specify the column name as a delimited identifier in editable format. For more information, see
Delimited Identifiers.
"phone #"
2. Enclose the delimited identifier and its surrounding quotes within single quotes to identify it to Report‑Writer as a string value in the variable=value clause:
info='"phone #"'
3. Enclose the variable=value clause in parentheses. If the parameter contains any characters treated specially by your operating system (such as parentheses in Windows NT), enclose the entire parameter within double quotes and escape any embedded double quotes to pass them through the operating system.
Windows:
Escape the double quotes surrounding a delimited identifier by preceding them with a backslash (\):
report personnel emp "(info='\"phone #\"')"
UNIX:
Escape the double quotes surrounding a delimited identifier by preceding them with a backslash (\):
report personnel emp "(info='\"phone #\"')"
VMS:
Escape the double quotes surrounding a delimited identifier by preceding each with another double quote:
report personnel emp "(info='""phone #""')"
For more information on how to pass delimited identifiers on the command line, see the System Administrator Guide.