SQL/MX 2.x Reference Manual (H06.04+)

MXCI Commands
HP NonStop SQL/MX Reference Manual540440-003
4-43
REPEAT Command
REPEAT Command
The REPEAT command reexecutes a previous MXCI command.
You can use REPEAT only within an MXCI session.
text
specifies the text of the most recent use of a command. The command must have
been executed beginning with text, but text need be only as many characters
as necessary to identify the command. Leading blanks are ignored.
[-]number
is an integer that identifies a command in the history buffer. If number is negative,
it indicates the position of the command in the history buffer relative to the current
command; if number is positive, it is the ordinal number of a command in the
history buffer.
The HISTORY command displays the commands or statements in the history
buffer. See HISTORY Command on page 4-31.
To reexecute the immediately preceding command, enter REPEAT without specifying
text or number. If you enter more than one MXCI command on a line, the REPEAT
command reexecutes only the last command on the line.
Examples of REPEAT
Suppose that you have a series of statements you have executed. Reexecute the
last SELECT:
>>REPEAT SELECT;
>>SELECT * FROM samdbcat.invent.partsupp;
PARTNUM SUPPNUM PARTCOST QTY_RECEIVED
------- ------- ------------ ------------
2000 95 1000.00 10
2010 99 30.00 20
2020 186 200.00 30
...
Reexecute the second to the last command:
REPEAT -2;
Reexecute the second command in the history buffer:
REPEAT 2;
REPEAT [text | [-]number]