MySQL Forums
Forum List  »  General

Re: INSERT, UPDATE, REPLACE INTO alternate key
Posted by: Peter Brawley
Date: December 19, 2012 05:16PM

> Q1: Is there a way to supply a separate field to be used as a "key" for a REPLACE INTO or a INSERT INTO command, such as (faux code):

?! Read again, that's exactly the question I answered.

If you intended to ask whether such key creation can be done within s REPLACE statement, the answer is no.

> Second question is whether modifying the PRIMARY KEY of an existing database, and setting it back after an operation, if that would result in any loss of data, unique identifiers, etc.

If the PK you are restoring is a correct candidate key, it will be fine unless the update process created duplicates in that PK.

Options: ReplyQuote


Subject
Written By
Posted
Re: INSERT, UPDATE, REPLACE INTO alternate key
December 19, 2012 05:16PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.