SQL Loader [message #160221] |
Thu, 23 February 2006 23:08 |
efftronics
Messages: 2 Registered: February 2006 Location: Vijayawada
|
Junior Member |
|
|
Hello Sir...
We have inserted the data in the table with CSV File using sql*loader. i.e., we created a CSV file and placed it in C:\ .
Then we used the command >sqlldr scott/tiger@[hostring] control=loader.ctl .
So the data in the CSN file was inserted into the table.But now we appended the data in file (CSV) and when we are trying to insert it using the same command ,it is showing the error " For INSERT option table must be empty " which is a point. So if we can read the last record address and then if we try to insert the command using the sql loader it will be better instead of truncating the table everytime.How can we append the data in the table.Please give the solution as early as possible.
----Regards..
EFF.
|
|
|
Re: SQL Loader [message #160231 is a reply to message #160221] |
Fri, 24 February 2006 00:24 |
rleishman
Messages: 3728 Registered: October 2005 Location: Melbourne, Australia
|
Senior Member |
|
|
The problem is with the word INSERT in you control file. It can take other values:
INSERT - loads the data file - table must be empty
APPEND - loads the data file - table may contain data already
TRUNCATE - truncates the table first, then loads
REPLACE - deletes (slow) the rows in the table first, then loads
If you want to fully replace the table, use TRUNCATE
If you want to just add new rows, use APPEND
_____________
Ross Leishman
|
|
|
|
Re: SQL Loader [message #160238 is a reply to message #160236] |
Fri, 24 February 2006 00:51 |
rleishman
Messages: 3728 Registered: October 2005 Location: Melbourne, Australia
|
Senior Member |
|
|
That control file should APPEND to a non-empty table.
If there are 100 rows in the table, and 500 rows in the data file, then the table should contain 600 rows after the load.
Ensure there are no unique indexes violated by the load.
If you are still having trouble, send the log file generated by SQL*Loader.
_____________
Ross Leishman
|
|
|
Re: SQL Loader [message #165040 is a reply to message #160231] |
Tue, 28 March 2006 02:27 |
rosiroy
Messages: 1 Registered: March 2006
|
Junior Member |
|
|
try this
load data
infile 'c:\mydata.csv'
append
into table example
fields terminated by "," optionally enclosed by '"'
( id, name,resume )
|
|
|