Disregard errors in inserting records [message #3044] |
Mon, 02 September 2002 00:32 |
Marjorin Mendoza
Messages: 15 Registered: September 2002
|
Junior Member |
|
|
Is there a way to disregard errors during insertion of records so I would come up with only those good and error-free data?
e.g. I have to insert 1000 records. Then, the 998th record had encountered a data type error. Can I still insert the first 997 records, 999th and 1000th record?
|
|
|
Re: Disregard errors in inserting records [message #3049 is a reply to message #3044] |
Mon, 02 September 2002 06:34 |
Mark
Messages: 284 Registered: July 1998
|
Senior Member |
|
|
I'd be interested to here a good solution for this too. One method I use, although for different reasons, it to update data through MS Access. This achieves the results you want - when the update is done, a message appears telling you the number of records that could not be updated and the reasons why - but the 'vaild' records are committed.
I'll be keeping an eye on this post too...
|
|
|
Re: Disregard errors in inserting records [message #3053 is a reply to message #3044] |
Mon, 02 September 2002 13:02 |
Todd Barry
Messages: 4819 Registered: August 2001
|
Senior Member |
|
|
If the rows are being inserted in a PL/SQL context, you can handle this easily using exceptions:
loop
-- some loop or cursor providing the 1000 rows
begin
insert into ...;
exception
when others then
null;
end;
end loop;
|
|
|
Re: Disregard errors in inserting records [message #3083 is a reply to message #3044] |
Tue, 03 September 2002 18:08 |
Manoj
Messages: 101 Registered: August 2000
|
Senior Member |
|
|
i insert nearly a million records into databases everyday, and to prevent the trasaction form failing i uses a combination on C, unix shell and oracle scripts. the concept i used is to insert 1 line at a time and commit it as i go. using 'C' and shell scripting greately improves the speed. and i takes us less than 20 mins to insert 1 million recorrd each has a 43 column rows. (i don't know if this helps, but you can use the concept behind it , i think).
|
|
|