Statement History

Statement History

Overview 

Every time a SQL statement executes it is saved in Statement History. This allows Andi users to find and re-run previously executed SQL statements. This saves time and helps to prevent recreation of SQL. 

The Statement History is ordered by execution time, with the most recent execution at the top of the list. If you run a statement in history multiple times and they are identical, the pre-existing statement will be moved to the top of the history list (but a new entry will not be added as they are considered identical).  

Access Statement History

To access Statement History, select the Tools Menu, and select Statement History:  

image-20250905-161550.png

The Statement History window will appear:

image-20250905-161558.png

Navigating Statement History

Statement Selection 

The Statement History will appear in the top section of the Statement History window. Statements will be stored in a file based on the database name, not the alias, as specified in the connection panel.  

Note: A maximum of 100 SQL statements (per database name) will be stored in the Statement History. When you reach the statement limit, the oldest statement will be deleted when a new statement is added.

image-20250905-161609.png

Run, Append, or Replace Statements

After a statement has been selected, users can:

  • Run the statement as it is displayed and append after existing statements.

  • Run and Replace - Completely replace existing SQL statements in the selected Query Editor: 

image-20250905-161619.png

 

Dynamic Filter

The Dynamic Filter allows users to simply begin typing in a piece of the statement they are looking for to dynamically narrow down the set of SQL statements. 

Wildcards "*" can be added at the beginning to filter based on a value which may occur anywhere in a statement. 

image-20250905-161630.png

Navigate Through Statements and Delete Statements 

To quickly navigate statements within the Statement History, simply select a starting point statement and then use the up or down arrows in the upper right hand corner to quickly move through each statement.

To delete a statement from history, select it from the Statement History and select the trash bin icon. 

image-20250905-161642.png