List:General Discussion« Previous MessageNext Message »
From:Jeremy Zawodny Date:September 18 2003 3:35pm
Subject:Re: Unique Key Violation - How to determine which key
View as plain text  
On Thu, Sep 18, 2003 at 08:20:00AM -0700, Scot Campbell wrote:
> O.K., I understand.  And I have always coded in this manner.
> 
> Throw the data at the system and see if it sticks.  In most cases it will.
> 
> However, when it does fail, it would be nice to determine the error w/o 
> issuing more calls.

Agreed.

> So, the school solution is, "When a unique constraint is violated, issue 
> selects for each of the unique contrained columns to determine which one was 
> violated"?

Yup.  That's all you can do, aside from parsing the error...
-- 
Jeremy D. Zawodny     |  Perl, Web, MySQL, Linux Magazine, Yahoo!
<Jeremy@stripped>  |  http://jeremy.zawodny.com/

MySQL 4.0.15-Yahoo-SMP: up 4 days, processed 181,918,749 queries (453/sec. avg)
Thread
Unique Key Violation - How to determine which keyScot Campbell17 Sep
  • Re: Unique Key Violation - How to determine which keyJeremy Zawodny17 Sep
  • Permission Problem in OS XDietrich Speer23 Jan
    • Re: Permission Problem in OS XBrent Baisley23 Jan
Re: Unique Key Violation - How to determine which keyScot Campbell17 Sep
  • Re: Unique Key Violation - How to determine which keyJeremy Zawodny17 Sep
Re: Unique Key Violation - How to determine which keyScot Campbell18 Sep
  • Re: Unique Key Violation - How to determine which keyJeremy Zawodny18 Sep
  • Re: Unique Key Violation - How to determine which keyHarald Fuchs18 Sep
Re: Unique Key Violation - How to determine which keyScot Campbell18 Sep
  • Re: Unique Key Violation - How to determine which keyJeremy Zawodny18 Sep