Home » RDBMS Server » Server Utilities » SQL Loader
SQL Loader [message #160221] Thu, 23 February 2006 23:08 Go to next message
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 Go to previous messageGo to next message
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 #160236 is a reply to message #160231] Fri, 24 February 2006 00:46 Go to previous messageGo to next message
efftronics
Messages: 2
Registered: February 2006
Location: Vijayawada
Junior Member
NO sir...
There is no 'INSERT' word in our control file.
anyways i'm attaching u the control file , you please see it . When we append the data in the CSV file and when we run the sqlldr scott/tiger@[hoststring] control=loader.ctl at command prompt this appended data must append into the table.We have tried by putting the 'APPEND' key in the control file also,But its not working.
Give me the solution please.
  • Attachment: loader.ctl
    (Size: 0.17KB, Downloaded 1676 times)
Re: SQL Loader [message #160238 is a reply to message #160236] Fri, 24 February 2006 00:51 Go to previous messageGo to next message
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 Go to previous message
rosiroy
Messages: 1
Registered: March 2006
Junior Member

try this Smile

load data
infile 'c:\mydata.csv'
append
into table example
fields terminated by "," optionally enclosed by '"'
( id, name,resume )
Previous Topic: loading selective data
Next Topic: ......Bulk Loading Formats in oracle....
Goto Forum:
  


Current Time: Fri Jul 05 18:49:21 CDT 2024