Previous Topic

Next Topic

Book Contents

Book Index

Query Builder - Statement Options tab

This tab allows you to specify a number of options relating to the type of SQL statement built.


Select Statement

This is the normal statement.

With Statement

This is discussed in WITH Statements.

Select Into

A Select Into creates a table containing the results of the query. Enter the name of the table you are creating in Table Name.

This option is only available for some databases such as SQL Server and Sybase ASE.

Create View

This will create a View from the query.

Enter the name of the View and whether (Include Col List) the column list is to be included in the View definition.

When you click on Run the view will be created. If you run it a second time you will get an error that the view already exists.


This option can used for coding other typers of queries.

Specify the “wrapper” for the query. The wrapper is the SQL statement which contains your query. When coding this wrapper text, specify $sql where the query-sql is to be placed.

TOP Clause

This specifies a TOP clause for SQL Server and Teradata. This returns the initial set of rows returned by the query.

Initial clause

This is a clause that can appear between the SELECT keyword and the column list.

Example for Teradata and SQL Server: TOP 50

End clause

This is a clause that is added to the end of your SQL.


Comments and Commands

When your query is parsed into the Query Builder (for instance from the Run SQL window) it may be preceded with Comments or AQT scripting statements (such as queryparm or setparm). AQT will not remove these comments and scripting commands; they will remain with the query. You can view or amend these in the Comments and Commands box.

AQT will only retain comments which precede your SQL. Comments that are contained within your SQL query will be removed when AQT imports the query into the Query Builder.

Clicking Disable will "remove" the command from your query. This is useful to prevent a queryparm command running every time you run the query.

Advanced Query Tool
© 2023 Cardett Associates Ltd. All rights reserved.