Subject Re: [Firebird-Architect] Replace the statement REPLACE
Author = m. Th =
Ann W. Harrison wrote:
>
> At the Firebird Conference, Vlad described the implementation of a
> REPLACE statement for Firebird 2.1. It is the short hand equivalent
> for "if you find a record that matches the primary or unique key give
> here, change the fields listed as listed, otherwise store a new
> record with these values."
>
> It was described as being like the MySQL REPLACE statement, and it is
> exactly the same syntax. However, the MySQL REPLACE behaves
> differently from the proposed Firebird statement, and, worse, the
> MySQL behavior is dumb. Their REPLACE deletes the matching record
> rather than updating it.
>

IMHO, I prefer _very_ much the Vlad's implementation.

>
> The semantics of the statement suggested by Vlad for Firebird are
> much better and the statement is useful. In our case, the ON UPDATE
> actions of constraints would be invoked as appropriate, and update
> triggers will fire. I suggest we use a different keyword so
> developers who have been exposed to MySQL don't assume we use their
> semantics.
>

Agreed.

> Here are some possibilities....
>
> SUPPLANT, SUBSTITUTE, SUPERSEDE, USURP, RECONSTRUCT, REBUILD, REDO,
> reconstitute; reconvert; renew, renovate; regenerate; rejuvenate,
> reestablish, restore, recreate...
>

For me: ENSURE, SUBSTITUTE,SUPERSEDE

> Regards,
>
> Ann
>

hth,

m. th.