Previous Topic

Next Topic

Book Contents

Book Index

Multiple query results

In AQT you can run SQL that produces multiple result-sets. This might happen if:

  1. You are running a script containing multiple Select statements (either in online-AQT or batch-mode AQT).
  2. You are running a stored procedure or a block of code that produces more than one result-set.

When you running a script (as in case 1) AQT not prompt you with the Export Data dialog when you click on Export Data/F7, instead it will prompt you for this when it processes the first result-set.

Creating a Single File

By default, AQT will write all data to a single file. After the first result-set has been written to the file, AQT will switch to Append mode - subsequent result sets are then appended to the file.

If you are doing this, you may wish to code a value for Write Text after data so that the sets of data are separated by a blank line or other delimiter.

Creating Multiple Files

It is possible to have your results-sets go to different files. You can do this by coding the keywords <schema> or <table> in your file name. AQT will replace these with the schema and table name of the table being exported, then will use this file name for the exports. AQT will only switch to append mode if it detects that the same file is used in subsequent result-sets.

If you are doing Export as Inserts, you can also include the <schema> and <table> parameters in the Table Name for Insert statements. AQT will replace these parameters in this table name before including it in the insert statement.

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