Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to import csv file into SQL developer

I have a db table's back up as 'csv file'.
I truncated the db table.
While importing the csv file using the sql developer, the data aren't getting inserted.
I amd following the procedure given in the tool.

Step by step procedure that I am following:

Right-click on table name and click import csv.
Choose the csv back-up file
Choose the header column in the data preview screen and click next.
Move all available columns to selected columns' side in the choose columns screen and click next.
Source and the target data columns are matching fine in column definition screen. Click next.
click verify in the finish screen. Success on all columns.
In the last step, I am clicking on finish and then it is loading the tables but there is no data restored into the table.

Can anyone please help me?

like image 614
Freakyuser Avatar asked Sep 25 '26 19:09

Freakyuser


1 Answers

When this sort of thing happens, the best way to triage is to have SQL Developer generate the INSERT statements instead of doing the actual insert.

So on one of the early steps, choose this -

enter image description here

Then when you finish the wizard, you should have an editor filled with INSERTs - one for every row in the CSV or Excel.

Connect to the right database, and execute those statements using F5.

And don't forget to COMMIT...if you want to keep the data.

like image 57
thatjeffsmith Avatar answered Sep 28 '26 09:09

thatjeffsmith



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!