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

Home -> Community -> Usenet -> c.d.o.server -> Re: sqlldr Question

Re: sqlldr Question

From: Sunil <sunil_franklin_at_hotmail.com>
Date: Wed, 22 May 2002 10:06:03 +0530
Message-ID: <sjFG8.25$sg6.15@news.oracle.com>


Thanks to every one for your ideas !
I am not on 9i so external tables is out ( sorry for not providing this info earlier )
Also I cannot truncate the table and reload as it will contain records entered by the user ( which has not come from the file ) Right now I think I will go with Richard's approach. It looks like just what I need, though I am bit concerned about the performance.

Thanks,
Sunil.

"Richard Kuhler" <noone_at_nowhere.com> wrote in message news:D_wG8.1080$wj7.217475_at_twister.socal.rr.com...
> I've used this trick before. Create a view for the target table with an
> 'instead of insert' trigger on it. Have the trigger perform the
> insert/update as necessary. Then just use the view as the target for
> sql*ldr...
>
>
> create table t (id number, val varchar2(30));
>
> create or replace view t_merge as select * from t;
>
> create or replace trigger trg_t_merge
> instead of insert on t_merge
> begin
>
> update t set
> val = :new.val
> where id = :new.id;
>
> if sql%rowcount = 0 then
>
> insert into t (
> id,
> val
> ) values (
> :new.id,
> :new.val
> );
>
> end if;
>
> end;
>
>
> Richard
>
>
>
> Sunil wrote:
> >
> > I need to load some data into a table from a file.
> > Later The file may undergo some changes and these changes will have to
be
> > reflected in the table. There is a pk column in the table (name) .
> > How can I go about this.
> >
> > Thanks,
> > Sunil.
>
Received on Tue May 21 2002 - 23:36:03 CDT

Original text of this message

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