I'm using Oracle 10g , SQL Developer I want to know if there is any way to import data from CSV file , which the fields separated by ',' and the lines terminated by '\n' using sql query i tried this query
LOAD DATA INFILE 'C:/tmp.csv' INTO TABLE CSVTEST2 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' IGNORE 1 lines (ID,FIRSTNAME,LASTNAME,BIRTHDATE);
But it didn't work and i always get error message from sql Developer telling me Unknow command
You need to use sqlldr utility in order to load data. Firstly create a control file (ends with an extension of .ctl) as per your requirements like mentioned below.
Now execute sqlldr utility to load data as mentioned below.
In Oracle SQL developer you can simply go to the list of tables on the left which should be under
connections
.Then Double click the table > actions > import data
You can then use the import wizard with your desired settings. I'm not sure if the feature was present in Oracle SQL developer when you asked this question, but it is available now.
You should be using Oracle SQL Loader for that, not sqlplus or SQL Developer
Alternatively you can use external tables:
Example on windows 10 and Oracle 12c
if you have a text file with records of each table delimited by comma, you can do this:
Create a control file for each table, called table_name.ctl (C:\Users\user\Desktop\directory\table_name.ctl)
After, In windows you should open Cmd and load data in each table, and then load data remotely for example in a aws server.
or
If you have the following error:“The program can’t start because oranfsodm12.dll is missing from your computer. Try reinstalling the program to fix this problem.”
it is because SQL * Loader is disabled and can not be used in the console windows, this is solved enabling the following steps (as http://www.dallasmarks.com/installing-two-oracle-12c-clients-on-one-server/):
Should go to the folder C:\oracle\client\user\product\12.1.0\client_1\BIN
Make a copy of oraodm12.dll file, calling the new file oranfsodm12.dll, and paste it in the same BIN folder.
Run the command again from cmd.