Re: How to update tables from flat-files

From: Ganesh Puranik <surya_at_usa.net>
Date: 1995/05/31
Message-ID: <3qieds$128_at_earth.usa.net>#1/1


: tvannama_at_imtn.dsccc.com (Tim Vannaman) writes:
: Chuck Hamilton (chuckh_at_ix.netcom.com) wrote:
: : Is there a way with SQL*Loader (or a simlar utility) to update existing
: : rows in an Oracle table from a delimited flat file? SQL*Loader looks
: : like it'll let you append new records, or replace the entire table
: : contents, but not do a simple update. What are your suggestions for
: : doing this?
: : --
: : Chuck Hamilton
: Tim.
:
: tvannama_at_ccmail.dsccc.com

>>>>

If you are not too comfortable with C but more comfortable with SQL, you could do the following:

Create a dummy table with the same structure as the one you need to load into. Write the following on insert trigger for it:

(Psedocode)

Check existance in real table where key = new.key; if exists in real_table then

   update real_table set field values to new_values else

   insert into real_table
end if;

Ganesh Puranik,
Consultant, Surya Systems, Inc. Received on Wed May 31 1995 - 00:00:00 CEST

Original text of this message