I suppose that is one way. It somehow seems wrong to force the unique index to do the job.
But barring any other solutions, that would work.
Is there a way of coding that 'on exception update' ?
Thanks for your reply.
oh, btw, yes there is a unique index on those 2 columns.
========================
-<<Floyd Wellershaus>>-
Database Administrator
Unix Administrator
email: fwellers@yahoo.com
Home: 703-430-0805
Cell: 703-477-6045
========================
http://www.one.org/
----- Original Message ----
From: Richard Spitz <Richard.Spitz@med.uni-muenchen.de>
To: informix-list@iiug.org
Sent: Friday, March 30, 2007 9:01:58 AM
Subject: Re: non alpha characters cleaning strings ??
Floyd Wellershaus <fwellers@yahoo.com> schrieb:
> here's where I'm lost now. I want to check for each row, if the combination key of ssn,hs_code
> exists in the destination table. If it exists, then updat the row with all the other values.
> If it doesn't exist then insert a new row.
Is there a unique index on the combination key in the destination table?
If so, then you could just try to insert the new row, and on exception -239
(Could not insert new row - duplicate value in a UNIQUE INDEX column) update
the row.
HTH, Richard
_______________________________________________
Informix-list mailing list
Informix-list@iiug.org
http://www.iiug.org/mailman/listinfo/informix-list