On Sun, Apr 22, 2001 at 09:07:38AM -0500, Steve Howard wrote:
> first perform the search against the database to see if the string
> is unique, then based on the results of that search, call one of two
> subroutines within that perl file.
The other frequent solution to this problem is simply to insert the
data, and trap the Duplicate key in index violation.
Actually, this question comes from the idea of "update the record if
it's there, otherwise insert a new one", which can also be expressed
as "insert a new record, otherwise update an existing one." Which
implementation you use depends on the proportion of duplicates to
unique entries.
--
Tommy Wareing
Software Engineer
Oxford English Dictionary
Oxford University Press