Skip to content
Advertisement

DBeaver: How to export a result without running 2 queries

I have a query that takes 3-5 minutes to run, so I’d rather not run the query once to generate the result set, and then a second time to generate the exported .csv file. Is there any way to only run the query once in DBeaver? Bonus if I get to visualize the output in DBeaver and then generate the .csv after without rerunning the query.

Answer

You can’t. Right now if you want to export the result set to a .csv, you need to rerun the query. However, a nice workaround is to first run the query on a subset (time, users, LIMIT, etc.) and once it’s good, you can directly export results to a .csv by doing the following in the editor:

right click > Execute > Export From Query.