Is there a max file size for the named query export to csv button?

I have a named query with over 10 million rows that I'm trying to export to csv. When I press the export to csv button the file select window doesn't popup. If I limit it to something like 900000 rows then it works like normal. Is there a known limit to rows or file size for the export to csv function?

The only 'limit' is how much memory the designer has, which is likely being exceeded because the 10,000,000 rows is directly from the table model.

I would strongly suggest doing this operation with a script, rather than relying on the export CSV button. Or, you know, just don't make a 10,000,000 row CSV file.

4 Likes

Thanks. Normally I wouldn't do it this was but I was asked to do it this way. We are in the process of moving cloud servers and don't currently have direct access to the windows box that runs the database. I also get the same memory error if I run this as a script.

It's probable there's some kind of error in the output console that will give you a clue as to what's going on.

I would run this operation from a script and batch it using a limit to say 100,000 rows or so, and then just append the rows into a dataset object or directly into the file.

5 Likes

I raised the designer memory to 4gb. This fixed the memory issue. This is the script I am using for anyone who may come across this thread.

table = system.db.runQuery("SELECT sqlt_data_1_20230125.* FROM sqlt_data_1_20230125")
csv = system.dataset.toCSV(dataset = table, showheaders = True, forExport = False)
filePath = "C:\Users\DustinCastleberry\Documents\SQL_Backup\sqlt_data_1_20230125.csv"
system.file.writeFile(filePath , csv)

I am trying to import the data into a new MySQL database but I get an error with anything that has a null value when trying to import.