Re: If it Exists... Update. If it DNE... insert.

From: <brlewis_at_my-deja.com>
Date: 12 Jul 2001 09:08:59 -0400
Message-ID: <nm9elrmxpjo.fsf_at_kindness.mit.edu>


muirwa_at_hotmail.com (muirwa) writes:

> However, given the simple steps above... For every one insert, there
> are probably 100,000 updates.

[...]

> Can I assume an "UPDATE", and then check what is returned (Metadata
> maybe?) (i.e. Rows Matched: 0 Changed: 0 versus Rows Matched: 1
> Changed: 1)

Absolutely. Especially in your case (100,000 updates per insert) you'll find it super efficient. I've done this a lot with JDBC (although not with Java).

-- 
Bruce R. Lewis				http://brl.sourceforge.net/
I rarely read mail sent to brlewis_at_my-deja.com
Received on Thu Jul 12 2001 - 15:08:59 CEST

Original text of this message