SQL/MX Report Writer Guide
Using MXCI and the Report Writer
HP NonStop SQL/MX Report Writer Guide—527194-002
2-14
Repeating Stored Commands
•
Use the PREPARE and EXECUTE commands. (For an example, see Preparing a
SELECT Command on page 3-25.)
•
Use the OBEY command.
To execute a set of commands repeatedly, use a text editor to put the commands in a
command file. For more information on examples of creating command files, see
Defining Reports in Command Files on page 2-15.
Repeating Stored Commands
You can use the FC and ! commands to repeat a command you have entered during
your MXCI session. The exclamation point command repeats a command but does not
allow you to modify it. The FC command allows you to edit the command before
reexecuting it.
To execute a previous command that begins with the text SELECT P, enter:
>> ! SELECT P
MXCI displays and executes the command:
>> SELECT PARTNUM, QTY_AVAILABLE
+> FROM PARTS;
Figure 2-6 shows two examples of repeating commands. The first example shows how
to revise a command and reexecute it by using the FC command. Enter sufficient text
to distinguish the command from other previously entered commands.
The second example in Figure 2-6 shows how to display the last 7 commands and
reexecute command number 3 by using the HISTORY command. You can use the
HISTORY command to display up to 25 of the most recently executed commands.
You can enter these commands at the S> prompt also.