Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: sqlldr Question
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 - 14:12:35 CDT