Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Adding changed records

Re: Adding changed records

From: Guido Konsolke <Guido.Konsolke_at_triaton.com>
Date: Wed, 7 May 2003 11:42:16 +0200
Message-ID: <1052300119.890218@news.thyssen.com>


"Randy Harris" <randy.harris_at_nospam.net> schrieb im Newsbeitrag news:jnPta.4395
> The Oracle 8i database will contain tables with customer information. I
am
> to be given a comma delimited flat file, on a nightly basis, containing
> changes to the data. The changes will include both updated records and
new
> records, with no hint as to which is which. I need to "synchronize" the
> changes into the database. I don't think a stored procedure is going to
be
> an option, that's why I asked for advice on doing it with either sqlplus
or
> sqlloader.
>
> It seems to me that it would be clumsy with sqlplus. I would have to read
in
> each of the lines from the cdf, then query to see if there was a matching
> record, then do either an UPDATE or and INSERT. I don't know much about
> sqlloader, but have been reading the documentation. I see that it can do
> either UPDATE or APPEND and discards records to a file. I thought perhaps
> there might be a mechanism in there somewhere. I was hoping that someone
> who has had experience in this area might get me started in the right
> direction.
>

As I read the docs, SQL*Loader doesn't UPDATE existing records. It INSERTs into empty tables and APPENDs or REPLACEs / TRUNCATEs populated tables. Why do you think that a stored proc is no option. You can read the rows of the file
using the UTL_FILE package and then do what Scott already posted.

hth,
Guido Received on Wed May 07 2003 - 04:42:16 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US