Previous Topic

Next Topic

Book Contents

Book Index

Using Intellisense

Intellisense is a feature of the Text Editor component which, as you type a query, will show a dropdown list of keywords, table names, column names or column functions. This is a great time saver when building a query.

This feature is context sensitive. AQT will parse your SQL and show you the dropdown list appropriate to your position in the query; for instance if you are in the column-list, AQT will show you the column-list dropdown, if you are in the table-list, AQT will show you table-list dropdown.

You have the choice of having the dropdown lists show automatically, or open when you hit a hot key. The hot keys are as follows:

Dropdown

Hotkey

keywords

Tab

keyword completion

Alt+K or Ctrl+Space

table name

Alt+T

column names

Alt+C

column functions

 

column values

Alt+V

Table List

AQT will show a dropdown list of the schemas in your database. If your database is one that does not have schemas, you will be shown a list of tables.

Run SQL Intellisense1

Once you have selected a schema, AQT will show you a list of tables in that schema

Run SQL Intellisense 2

Some notes:

Column List

Important - before AQT can give you a drop-down of column names, you must hit F2.

When F2 is hit, AQT will parse your SQL to determine the tables in your query, and will fetch the column names for your tables. This must be done before AQT is able to show you a drop-down list of your columns. You should also hit F2 if you change the tables in your query, or change the correlation names (table-ids) of the tables.

The column-list drop-down is shown after a blank or comma is hit and you in a column-list or where-clause part of the SQL. Alternatively, you can activate the column-list drop-down with Alt+C.


SQL Intellisense 3

Column Function

AQT also has the ability to show a dropdown list of column functions. You do this by typing a fullstop after the name of a column - once you have selected the column, it will be applied to the column names using the normal function syntax.

Using Intellisense with a multi-table query

Intellisense can be used when your query contains multiple tables. AQT understands the syntax for a multiple-table query; when you need to refer to a column-name, AQT will give you a dropdown of the table-ids. This is shown in the following example. When you select a table-id, you will be given a dropdown of the columns within that table.

Run SQL Int6

Note that for multi-table queries, it is strongly recommended that you use table-ids with your tables (these are emp and empinfo in this example). If these are not given, column names can be ambiguous (eg. AQT may not know which table a column is in), which can cause problems with the way this component works.

Keyword Dropdown

A dropdown list of keywords does not happen automatically, but only when you hit Alt+K or Ctrl+Space

Switching Intellisense On and Off

By default, Intellisense is active. You can switch off by clicking on the Intellisense button in the Edit Toolbar. This can be useful if you are typing a lot of text into your SQL.

Intellisense1

Options

Options governing the use of Intellisense are in Options > Run SQL > Intellisense.

Advanced Query Tool
https://www.querytool.com
© 2023 Cardett Associates Ltd. All rights reserved.