My office does not have a good datawarehouse and i can only query against 999 records at a time.
how can i have it loop to run the next set of records and export to excel and name each sheet for the query results, or better yet append to the end of each query?
Most files I’m running are in the 2k-5k records, so multiple queries are needed.
Also, one of my fields is a comment field, so i’m afraid if i export to a cvs i will truncate data.
If you export to the same Excel file you have it append a new unnamed worksheet. There currently is no way to append the data (Although that is a requested enhancement).
To export to a new worksheet you can do this in one of two ways.
Using the export wizard, use the add query type. Add a script that containis multiple SQL. Each select result will be sent to new worksheet. (Note: If you use a named worksheet it will over write it.
IE: Select * from table limit rows 1 -999;
select * from table limit rows 1000 - 19999
The Syntax is not correct but this just shows the idea.
Use automation to execute a loopdataset. Here you can use bind variables in your select.
I’d choose item 1 if you can put together the SQL without binds.