| List: | General Discussion | « Previous MessageNext Message » | |
| From: | Jeremy Zawodny | Date: | September 18 2003 4:48am |
| Subject: | Re: Unique Key Violation - How to determine which key | ||
| View as plain text | |||
On Wed, Sep 17, 2003 at 03:07:41PM -0700, Scot Campbell wrote: > These will be random atomic Inserts originating from a Web page. > > I'm not sure I catch your drift. The inserts are not in a batch. > > I need to notify the user on the page which field was in error. I'd like to > refer to the index name in the schema and relate it to the field that > contains the non-duplicate data (i.e., error message on the email address > vs. error message on the userid field). What I'm saying is this. If you expect most inserts to succeede, then code that way. Insert a row. If it fails, then go to the effort of finding the offending key. Otherwise, if you check every key before the insert, you're wasting effort most of the time. That's all. -- 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 158,913,444 queries (438/sec. avg)
| Thread | ||
|---|---|---|
| • Unique Key Violation - How to determine which key | Scot Campbell | 17 Sep |
| • Re: Unique Key Violation - How to determine which key | Jeremy Zawodny | 17 Sep |
| • Permission Problem in OS X | Dietrich Speer | 23 Jan |
| • Re: Permission Problem in OS X | Brent Baisley | 23 Jan |
| • Re: Unique Key Violation - How to determine which key | Scot Campbell | 17 Sep |
| • Re: Unique Key Violation - How to determine which key | Jeremy Zawodny | 17 Sep |
| • Re: Unique Key Violation - How to determine which key | Scot Campbell | 18 Sep |
| • Re: Unique Key Violation - How to determine which key | Jeremy Zawodny | 18 Sep |
| • Re: Unique Key Violation - How to determine which key | Harald Fuchs | 18 Sep |
| • Re: Unique Key Violation - How to determine which key | Scot Campbell | 18 Sep |
| • Re: Unique Key Violation - How to determine which key | Jeremy Zawodny | 18 Sep |
