Subject RE: [firebird-support] Re: Getting duplicate records in a table
Author Paul Hope
Hi Adam

Maybe I'm missing something here - but why not do the insert with a SP using
IF NOT EXISTS(...) then INSERT INTO ...?

Paul

> -----Original Message-----
> From: firebird-support@yahoogroups.com
> [mailto:firebird-support@yahoogroups.com] On Behalf Of Adam
> Sent: 27 April 2006 01:02
> To: firebird-support@yahoogroups.com
> Subject: [firebird-support] Re: Getting duplicate records in a table
>
> Thanks Radu / Ann,
>
> Radu,
>
> The table is a notification table for a mini replication of a
> subset of data.
>
> Obviously I could declare the combination of FieldA, FieldB
> unique in the first instance, but this would mean there would
> be a possibility of losing information if a notification hit
> at the same time the application checked in and removed the
> notification. The isolation level would mean that the
> notification record insert would fail (which could be caught
> using the -803 thing), but the application would not see the
> latest version.
>
> Your suggestion however has given me an idea that may work. I
> could insert a new record in this notification table, then
> attempt to remove any prior records (ignoring any exception
> if both a new notification and an application synchronising
> attempt to delete simultaneously).
>
> I will do some tests to see if this will solve my problem.
>
> Adam
>
>
>
>
>
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://firebird.sourceforge.net and click the Resources
> item on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Yahoo! Groups Links
>
>
>
>
>
>