Subject Re: [IB-Architect] Rows Affected inside of a stored procedure or trigger
Author Jim Starkey
At 09:59 PM 11/29/01 -0700, Jason Wharton wrote:
>Sean,
>
>> I believe that Jim had once posted that in Netfrastructure he had create
>> a new keyword REPLACE, which updated a record if it existed, otherwise
>> it inserted a new row.
>
>I'm aware of that but if I am not mistaken, that was where metadata items
>were concerned was it not? That wouldn't be possible with data unless there
>was a built-in semantic for unique record identification as there is with
>metadata updates. I presume it would only be possible with tables containing
>a primary or unique key. Otherwise, there is a potential element of
>ambiguity which might have some painful consequences.
>

A primary key is indeed required for the table. Furthermore, the primary
key fields had to be supplied in the field list. But since these are
required to perform the INSERT operation, it isn't much of burden.

On the other hand, requiring the database engine to do a non-indexed
scan of a table to determine whether a key was unique strikes me a
a rather poor design, and not something Firebird should want to
encourage.

Jim Starkey