SQL/MP Reference Manual
HP NonStop SQL/MP Reference Manual—523352-013
O-2
Considerations—OBEY
Specify sections within a command file by including a section header starting in
column 1 at the beginning of each section:
?SECTION section-name
The section-name is an SQL identifier that is the name of the section. Each
section name within a file should be unique, because SQLCI executes only the first
section it finds that has the name you specify in an OBEY command.
Most command files are simply EDIT files that contain SQLCI commands (and,
optionally, section headers). You can create or modify command files any way you
normally create or modify EDIT files, typically with the EDIT or TEDIT text editor.
NonStop SQL/MP also creates three types of command files for you:
SQLCOMP creates a command file that sets DEFINEs used by a program if
you compile the program with the EXPLAIN DEFINES option and specify
OBEYFORM. See the SQL/MP programming manual for your host language.
The SAVE command creates a command file that sets up a report definition or
other SQLCI session options. For more information, see SAVE Command on
page S-2 or the SQL/MP Report Writer Guide.
The LOG COMMANDS command logs SQLCI commands you enter. You can
then create an SQLCI OBEY command file from the log file.
In all three cases, you can use the command file as it is or modify it with an
editor.
You can nest command files to four levels beyond the SQLCI IN file. For example,
if you enter OBEY FILE1 at the terminal (IN file) and FILE1 contains OBEY FILE2,
FILE2 contains OBEY FILE3, and FILE3 contains OBEY FILE4, FILE4 cannot
contain an OBEY command. You can have at most five files open including the IN
file.
A command file cannot include an OBEY command that executes commands from
the same command file, however, even if the commands are within another section
of the file. (Inclusion would violate the restriction that the command file specified in
the OBEY must be closed, because a command file remains open while SQLCI
executes it.)
Within a command file, SQLCI executes commands until it reaches the end of a
section, the end of a file, another OBEY, or an EXIT command. When it reaches
the end of a section or file, SQLCI returns to the line following the OBEY command
that initiated execution of that section or file.
If the BREAK_KEY option is ON, you can stop the execution of commands in a
command file by pressing the Break key at the terminal from which you issued the
OBEY. SQLCI closes the command file and prompts you for a new command. If a
transaction is in progress, it is rolled back.