I have 50 tables on a schema on Oracle server. Each table has roughly 1 million rows. I want to export all tables to separate excel files. I only need 10 rows for each table. I know I can select 10 rows and manually export it to excel file one by one. Is there any way to set exporting only 10 rows in Export Wizard, and export 50 tables to separate excel files in batch (automatically)? Thanks.
2 Answers
Tools - Database Export
Note the output type is set to Separate Files and we're pointing to a directory.
If you set it to a single file, you'll get one excel file with 50 worksheets.
Pick your tables, and set GLOBAL WHERE CLAUSE
Click Next, then Finish, and you're off to the races.
-
Cool, great to hear that @Michael, now just mark my answer as 'Correct' -> and welcome to StackOverflow! Commented Sep 12, 2019 at 16:49
-
Sir, Another question. Is it possible to transpose all these tables when exporting to excel files?– MichaelCommented Sep 12, 2019 at 17:40
-
I am new here, could you tell me how to make your answer as "correct"?– MichaelCommented Sep 12, 2019 at 17:41
-
Just click the checkmark toggle next to the answer that helped you Commented Sep 12, 2019 at 18:20
This is not exactly what you asked, but when I asked Google a similar question I ended up here so I figured I'd add what I did to help the next person.
If you want to see an INSERT for one or many rows in SQL Developer:
Tools > Database Export
Select your connection, Uncheck Export DDL & Change "Save As" to "Worksheet"
On "Types to Export" select Tables only
On "Specify Data" Type the name of your Table in "Name", then click "Lookup"
Click your table then move it down
Click The empty Object Where space next to the Database Object:
Click the Pencil
This will bring up the Data Where Window (I have blocked my data just in case). Click into the Object Where text input:
Enter your clause that will match whatever rows you want to see the INSERT statement for. For me it was
PROC_ID=0000
.Click Refresh and a list of your rows should appear. Check to make sure your WHERE got the correct tables.
Click OK, Next, then Finish and you should get a new worksheet with the insert command. If it's not what you expected try different WHERE clauses.
My case was a little different. I wanted to just get the INSERT for one row in a complex table. Then I'll use the INSERT as a template for adding new rows. And since I'm doing this, it's better for me to get it in SQL Developer instead of separate files.
Thanks to @thatjeffsmith for steering me in the right direction.