I have a CSV file which contains an ID and several other columns. I also have a table in oracle where the ID identifies a row. How can I best replace the values that are in
Use SQL*Loader
sqlldr username@server/password control=load_csv.ctl
The load_csv.ctl file
load data
infile '/path/to/mydata.csv'
into table mydatatable
fields terminated by "," optionally enclosed by '"'
( empno, empname, sal, deptno )
where /path/to/mydata.csv is the path to the CSV file that you need to load, on Windows something like C:\data\mydata.csv. The tablename is mydatatable. The columns are listed in order that they apear in the csv file on the last line.
Unless you have a very large volume of data this is the easiest to maintain way of getting the data in. If the data needs to be loaded on a regular basis this can be worked into a shell script and run by CRON on a U*NX system.