Previous Topic

Next Topic

Book Contents

Book Index

Running your SQL

You can run your SQL by clicking on Run or hitting F5. AQT will pass your SQL to the database then display the data (if there are any). If there are any error messages, you will see them on the status bar at the bottom of the window.

Run only part of SQL

If you only want to run part of your SQL, select the part you want to run and click on Run. If you have text selected, AQT will run only the selected text.

Select current statement

If your SQL consists of multiple statements, hitting Run > Select Current Statement (or F4) will select the current statement. You can then run this with F5.

Cancel a query

AQT allows you to cancel a long-running query. This is discussed more detail in Options > Cancel Queries.

Use transactional control

You can run your SQL under Transactional Control. This allows you to back-out an update if it does not do what you require. See Transaction mode for more on this.

Syntax-check SQL

You can do a Syntax Check of your SQL. You do this with Edit > Check Syntax (or F6). AQT does the syntax check by doing a "prepare" of your SQL against your database. This feature does not work with some databases (depending on whether "deferred prepare" can be disabled).

Explain plan

For Oracle, DB2 z/OS, DB2/UDB, SQL Server, Sybase, MySQL, IDMS and Teradata you can do an Explain Plan of your SQL. You do this by Edit > Explain Plan (or F8). See Explain Plan for more information on Explain Plan.

Running a DB2 Command

AQT can run a DB2 Command by invoking the DB2 CLP (Command Line Processor). This is described in the section Running a DB2 Command.

Running using SQL*PLUS

You can run your SQL under SQL*PLUS by selecting Run > Run using SQL*PLUS. AQT will invoke SQL*PLUS and pass your SQL to this.

This can be useful if you are trying to debug a complicated piece of SQL. AQT cannot display the line / columns where an error has occurred (this is a limitation of the ODBC driver). However, SQL*PLUS can display this information.

This function is for Oracle only.