Limitation on Export data as SQL file jonwat 04/25/24 09:36 PM
If you have a query like:

with some_CTE as
(...)
select [some_columns]
from
(select [columns]
from complicated query
join some_CTE on ...)

then using either version of Export Results you cannot export the data as a SQL file (or to clipboard as a SQL file) I believe it is because the export process is unable to figure out what you want the target table to be, as in :

insert into [some target table] (FILE_NO, BENEFIT, AMT_3YRS, LAST_DATE)
values (728833, 'Non-medical Transportation-Household Moving and Storage-In District', 958.15, '2024-01-21');

Using a SQL file was by far the easiest way to accomplish what I needed (transferring data from Oracle to SQLite), and the only way I could do this was to save the results to a temporary table using CTAS and then select from the temporary table and create the SQL file from that. Moving the CTE into the query didn't help.

Apart from the fact that it took a while to figure out what was going on (the export just does nothing; doesn't pop up an error message), it would be much more sensible to ask for a name for the target table when it cannot figure it out.

Jon
0 1 Read More