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

MXCI Commands
HP NonStop SQL/MX Reference Manual540440-003
4-27
Exclamation Point (!) Command
Exclamation Point (!) Command
The exclamation point (!) command reexecutes a previous MXCI command.
You can use ! 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 an exclamation point without
specifying text or number. If you enter more than one MXCI command on a line, the
exclamation point reexecutes only the last command on the line.
Examples of !
Suppose that you have a series of statements you have executed. Reexecute the
last SELECT:
>>! 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:
!-2;
Reexecute the second command in the history buffer:
! 2;
! [text | [-]number]