Limit number of exported / imported rows in DBeaver
Asked Answered
M

2

5

is there a way to limit the number of rows while exporting or imported data in DBeaver?

In my case I have a remote DB2 and I need to import SOME rows of a specific table into a local MySQL DB that I have.

Is there a way to do that?

Thanks

Marx answered 18/5, 2020 at 10:38 Comment(0)
D
5

Limiting the number of rows being exported only makes sense if the export wizard knows what rows (e.g. order) to export. Therefore it only makes sense to export the resultset of a query, as opposed to export the actual table with a limiting factor.

This is how you can do this in DBeaver:

  1. Issue a query like SELECT * FROM my_table ORDER BY mycolumn LIMIT n.
  2. Replace n with any integer you like obviously. You may also add DESC after mycolumn, if only the most recent rows make sense to you.
  3. Run the query.
  4. In the pane with the resultset, locate the button tooltipped "Export result set to fil or another table". It looks like a tray with an upward arrow. In DBeaver 7.2.2, it is just left of the split number and cog buttons.
  5. Run that wizard, selecting "SQL" target type (Export to SQL INSERT statements)
  6. Click Next, and configure any other export preferences (you may leave default too).
  7. The file being exported should content you.
Disjunct answered 27/10, 2020 at 9:57 Comment(0)
A
2

You can select the rows you want to export in the results and right click, select Avanced Copy and export those rows to the clipboard in the selected format.

Anele answered 6/9, 2023 at 19:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.