RE: Insert/Update from file
Posted in 2001
You are correct. I forgot that piece. I am chary of using a delete join.
While it is a wonderful tool, when deleting a large number of rows it can be
more costly than rewriting the entire dataset.
We also have an update requirement in the code segment I made up yesterday.
We take the keys from that dup_check table which have a count(*)=2, dump
those into a table, from that table pull out the rows which will require
update and apply the update.
Using the HPL load method, those rows which were rejected could also be used
to update directly.
(sorry to be brief - I'm operating at half-steam today - sick kids and maybe
me too. Of course maybe everybody prefers me being brief).
cheers
j.
> -----Original Message-----
> From: cedarsiding@my-deja.com [mailto:cedarsiding@my-deja.com]
> Sent: Wednesday, February 07, 2001 2:03 PM
> To: informix-list@iiug.org
> Subject: RE: Insert/Update from file
>
>
> Unless I missed something, the original poster was
> trying to do what's been termed an "UPSERT" operation.
> I.e. insert if it's not already there, update if it is.
> Jack, I don't see where your process performs the
> updater part. You seem to be just inserting then
> non-dups. Again, unless I read it wrong; if so,
> please clear me up on that.
>
> The most recent versions of XPS support something
> like UPSERT via their "delete join" mechanism.
> It is a two step process, something like this:
>
> 1. delete from target
> using target, new
> where target.key = new.key
>
> 2. insert into target
> select * from new>
> -cs
>
>
> Sent via Deja.com
> http://www.deja.com/
>