Previous Topic

Next Topic

Book Contents

Book Index

Other options in the Run SQL window

Display options

You can change the font used in the text box with Edit > Change Font

You can change the case of the selected text with Edit > Change Case

Editing functions

You can right-click the text-box to get a drop-down list of the Edit menu items.

You can Comment or Un-Comment a block of text with Edit > Comment Text and Edit > UnComment Text, or the Comment/UnComment icons.

You can Find and Replace text with Edit > Find and Edit > Replace, or use the Find icon.

Keyword management

You can add or remove entries from the Keywords and Operators listboxes. This is useful if there is an SQL keyword or phrase you use frequently. The keywords are held in file sqlkeywords.txt (in your AQT directory). You can edit this file to change the entries that appear in the listboxes.

You can edit this file by right-clicking the listbox and selecting Edit Keywords. If you have changed the keywords outside the control of AQT, Reload Keywords will reload the listboxes from the keywords file.

Line Numbers

You can have line numbers on your text by selecting View > Line Numbers

Line Wrap

You can specify whether text is wrapped with View > Line Wrap (Ctrl+W).

If you switch off line-wrap, there is a limit to how far right you can scroll (so not all your text will be visible). This is a problem with the text control which we have raised with the developer. You will be able to see all your text by switching on Line Wrap.

Bookmarks

The edit control supports the use of bookmarks. This makes it easy to find your way around a large script.

When using Bookmarks, it is recommended that View > Line Numbers be set on.

Moving around your SQL

The following keys are useful to move through your SQL.

Find Bracket

This function is useful if your SQL has many indented levels of brackets. Position the cursor at a bracket and hit Edit > Find Matching Bracket (or F12)

If you select Edit > Select to matching bracket (or Shift+F12), AQT will select (highlight) the text between the current bracket and the matching bracket.

Send query result to SQL window

You can use Export Data To > SQL Window to send the query result back to the SQL Window. This is useful if you are running an SQL statement that is generating SQL statements.

Format SQL

You can format an SQL statement by clicking on Edit > Format SQL. This will reformat your SQL in a layout which is more easily read.

Insert statements will be formatted in a way which makes it easy to match the insert-value with the column being inserted; if the insert statement has a column list, the column name will be given (preceded by the comment indicator --) to the right if the column value. This syntax may not be valid for many databases, for which the comment indicator can only be given at the start of a line. However such insert statements will run OK within AQT as long as Options > Run SQL > Remove Comments from SQL is selected (by default it will be).

Both Format SQL and Unformat SQL will replace x'A0' characters with spaces. x'A0' is a "non-breaking space" that can appear in your SQL if you have pasted it from an email.

Unformat SQL

You can unformat your SQL by clicking on Edit > Unformat SQL. This will remove all linebreaks and extra spaces from your SQL.

Wrap to 60 chars

This will split your SQL into multiple lines, with each line a maximum of 60 characters.

This function may not work if you have text literals greater than 60 characters (AQT will not split these) or have text literals which span lines.