In AQT you can run SQL that produces multiple result-sets. This might happen if:
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.
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.
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.