history

Syntax

history [-all] [-h] [-r] [num_commands]

Description

ttIsql implements a csh-like command history.

Lists previously run commands. The num_commands parameter specifies the number of commands to list. If the num_commands parameter is omitted then the previous 10 commands are listed by default.

The output of this command omits consecutive duplicate commands. Use the -all option to include the consecutive duplicate commands.

Use the -h option to omit the command numbers.

Use the -r parameter to list the commands in reverse order.

The history list stores up to 100 of the most recently run commands. The history command by default displays the last 10 SQL statements or ttIsql built-in commands that were run. To display more than that last 10 commands, specify the maximum number to display as an argument to the history command.

Examples

Command> history;
1 INSERT INTO T3 VALUES (3)
2 INSERT INTO T1 VALUES (4)
3 INSERT INTO T2 VALUES (5)
4 INSERT INTO T3 VALUES (6)
5 autocommit 0
6 showplan
7 SELECT * FROM T1, t2, t3 WHERE A=B AND B=C AND A=B
8 trytbllocks 0
9 tryserial 0
10 SELECT * FROM T1, t2, t3 WHERE A=B AND B=C AND A=B
Command>
Each entry in the history list is identified by a unique number. The ! character followed by the number of the command can be used to run the command again. For example:
Command> ! 5;
autocommit 0
To run the last command again simply type a sequence of two ! characters:
Command> !!;
autocommit 0
To run the last command that begins with a given string type the ! character followed by the first few letters of the command. For example:
Command> ! auto;
autocommit 0