SQL/MP Reference Manual
HP NonStop SQL/MP Reference Manual—523352-013
O-1
O
OBEY Command
OBEY is an SQLCI command that executes SQL statements and SQLCI commands
from a file.
OBEY executes the statements and commands exactly as if you had entered them
from the terminal. After execution, SQLCI closes the file but does not return any setting
changed by the commands (such as a session attribute) to a previous state.
OBEY is often used to set DEFINEs or define reports, but is useful in any situation in
which you repeat a sequence of statements or commands. Using OBEY to execute
statements and commands from files makes tedious jobs faster, easier to reproduce,
and more reliable.
cmd-file
is the name of a closed file that contains commands to execute.
The file (called a command file or an OBEY command file) is usually an EDIT
disk file, but can also be a device or process. It cannot be the SQLCI IN, OUT, or
log file, or an executing command file, however, because these files are open.
section
is the name of a section in the file to execute.
For each section you specify, SQLCI executes the lines in the file from the
named section header to the next section header (or the end of the file). If you
specify more than one section, SQLCI executes the sections in the order in which
they appear in the file, not in the order you specify them. If more than one section
in the file has the name you specify, SQLCI executes only the first one; other
sections with the same name are ignored.
If you omit section, SQLCI executes all lines in the file.
Considerations—OBEY
You can use named parameters as literals in DML statements or SQLCI
commands within command files. Use SET PARAM to supply values for the
parameters before you use OBEY to execute the statements or commands. For
more information, see Parameters on page P-11.
O[BEY] cmd-file [ ( section [ , section ] ... ) ] ;