List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:September 21 2001 10:12pm
View as plain text  
At 4:27 PM -0400 9/21/01, Jason Frisvold wrote:
>Currently I'm checking to see if a value exists in the database before
>deciding whether to update it or insert it.  Would this be quicker to do if
>I merely used REPLACE?  Is that the purpose of the REPLACE command?  If it
>exists, just update it, and if it doesn't exist, insert it?

Right.  The table must have a PRIMARY KEY or UNIQUE index.
The decision as to whether to replace or insert is based on whether
a record with the same unique key value already exists.

>Jason H. Frisvold
>Senior ATM Engineer
>Engineering Dept.
>CCNA Certified - CSCO10151622
>"So Long and Thanks for all the Fish" -- Douglas Adams [1952-2001]

Paul DuBois, paul@stripped
REPLACE vs INSERT/UPDATEJason Frisvold21 Sep
  • Re: REPLACE vs INSERT/UPDATEPaul DuBois22 Sep