ISQL and Tools
Description
The HISTORY statement lists the statements in the statement history buffer, along with an identifying number.
Notes
•ISQL maintains a list of statements typed by the user in the statement history buffer. The SET HISTORY statement sets the size of the history buffer.
•The statements LIST, EDIT, HISTORY, and RUN are not added to the history buffer.
•Use HISTORY to obtain the statement number for a particular statement in the history buffer that you want to execute. Then, use the RUN statement with the statement number as an argument to execute that statement. Or, use LIST statement with the statement number as an argument to make the statement the current statement, which can then be executed using RUN without an argument.
Example
The following example illustrates usage of the HISTORY statement.
ISQL> HISTORY
1start start_ex.sql Ship
2SELECT customer_name FROM customers WHERE customer_name LIKE 'Ship%'
3select tbl from systables where tbltype = 'T' ISQL> RUN 2
WHERE customer_name LIKE 'Ship%'
CUSTOMER_NAME
Ship Shapers Inc.
1 record selected
ISQL> HI
1start start_ex.sql Ship
2SELECT customer_name FROM customers WHERE customer_name LIKE 'Ship%'
3select tbl from systables where tbltype = 'T'
4SELECT customer_name FROM customers WHERE customer_name LIKE 'Ship%'
ISQL> LIST 3 – Display statement 3 and copy it to the end of the history list select tbl from systables where tbltype = 'T'
ISQL> history
1start start_ex.sql Ship
2SELECT customer_name FROM customers WHERE customer_name LIKE 'Ship%'
3select tbl from systables where tbltype = 'T'
4SELECT customer_name FROM customers WHERE customer_name LIKE 'Ship%'
5select tbl from systables where tbltype = 'T'
FairCom Corporation |