问题
Normally I use Dbeaver for windows and always export my result set like this:
- Run my query --> select the result --> export the result set --> select export to clipboard --> done
This step by step puts my result set in my clipboard and I can paste it wherever I want to work with it.
The problem is that now I am using dbeaver for mac and this guide is not working. I can go on until the moment that I select my result set like in the image below:
But once I go further in the process, in the last step I get: no query
Note that in "source" it was suppose to show the query that originated the result set, but instead it says just "select.
As a result it does't select my result or anything (besides being "successful").
Normally my query would show up there automatically and I couldn't find any option that corrects this problem in the menus.
回答1:
You don't need to use the clipboard, you can export directly the whole resultset (not just what you see) to a file :
- Execute your query
- Right click any anywhere in the results
- click "Export resultset..." to open the export wizard
- Choose the format you want (CSV according to your question)
- Review the settings in the next panes when clicking "Next". (No need to change anything in my case)
- Set the folder where the file will be created, and "Finish"
The export runs in the background, a popup will appear when it's done.
In newer versions of DBeaver you can just :
- right click the SQL of the query you want to export
- Execute > Export from query
- Choose the format you want (CSV according to your question)
- Review the settings in the next panes when clicking "Next". (No need to change anything in my case)
- Set the folder where the file will be created, and "Finish"
The export runs in the background, a popup will appear when it's done.
Compared to the previous way of doing exports, this saves you step 1 (executing the query) which can be handy with time/resource intensive queries.
回答2:
The problem was the box "open new connection" that was checked. So I couldn't use my temporary table.
回答3:
Is there a reason you couldn't select your results and right click and choose Advanced Copy -> Advanced Copy? I'm on a Mac and this is how I always copy results to the clipboard for pasting.
来源:https://stackoverflow.com/questions/43329790/export-result-set-on-dbeaver-to-csv