Overview of Running A Query

Overview of Running A Query

Overview 

The Query Editor is designed for users to create, modify, and run single or multiple SQL statements. The Query Results are available for each statement that is run which will contain the data results for review and manipulation. This article will go into detail the following: 

Query Editor

Schema / Catalog Name Selection

The schema / catalog name selection list allows users to pick the current schema for a Query Editor. The schema selected will be used to fully qualify table and column names which are not already fully qualified in the SQL statement: 

image-20250905-150910.png

Multiple Query Editors 

Users can open as many Query Editors per Connection as needed by selecting the green "+" button from the icon menu in the upper right hand corner:

image-20250905-150923.png

Each Query Editor with the same schema name will share a physical database connection. If a new Query Panel is created and a new schema is selected, a new connection will be created automatically:

image-20250905-150934.png

Note: Not all databases support the notion of a current schema. Please refer to your database documentation for more details.

Query Editor Menu Options

Each Query Editor open has a menu available with options to Detach the Query Editor (for longer running queries), Add Comment (custom text will appear when hovering over Query Editor tab), or Close out of the Editor completely (users can also close a Query Editor by using the red 'X' menu icon in the upper right hand corner). 

image-20250905-150953.png

Run and Quick Run

Run

Whenever a SQL statement is entered into a Query Editor it can be Run to produce Query Results by selecting the Run button (or the Andi Hotkey ALT-R can be used): 

image-20250905-151001.png

Quick Run

The Quick Run option works in tandem with the Query Editor, and is available to help users create and run Queries efficiently - without needing to write any SQL! 

As an example, the Table name SCHOOL has been entered into the Query Editor (as a tip - the Andi Hotkey ALT-T can be used to bring up a list of all available Tables to add to a Query Editor). Then, the Table name is highlighted (double mouse click) and the Quick Run option is selected: 

image-20250905-151012.png

The Quick Run for Table menu will appear with options to select which columns should be included or excluded in the Query, as well as controls to order the columns. Users can also select whether the resulting Query should be a Select Statement or an Insert Statement:  

image-20250905-151025.png

The Parameter Entry Dialog will appear, which allows users to enter values for variables for each column that was included for the statement. Any values entered as a variable will filter the resulting records, without having to manually create any SQL.

In the below example, the School Name filter was selected, and values were added for any School Name that includes WEST and SAN JUAN:

image-20250905-151047.png
image-20250905-151058.png

By selecting Run, Andi will automatically generate the SQL statement and display the data results in the Query Results section: 

image-20250905-151111.png

Query Results

Query Results are shown beneath the Query Editor whenever a SQL statement is run: 

image-20250905-151125.png

Note: Reference the Andi Help Center article Overview of Working With Query Results for in depth information about working with Query results!

Andi Hotkeys

Andi has many unique Hotkeys that can be used to increase efficiency when working in the Query Editor. The following is a reference for the ALT-T Hotkeys available: 

image-20250905-151141.png