Looks like the process for MySQL is very similar to the Oracle one I posted
a link to earlier and someone else wrote an example of.

http://forums.macrumors.com/showthread.php?t=403320



On Fri, May 16, 2008 at 10:25 AM, Rick Faircloth <[EMAIL PROTECTED]>
wrote:

> Ok... I created a unique index on photo_filename and it definitely
> stopped the process by throwing an error.  In the CF app log, it states
> "Error Executing Database Query.Duplicate entry '94219_0.JPG' for key 2"
>
> So how do I modify the query, which now looks like this...
>
> insert into hmls_photos
>            (photo_filename, photo_mls_number)
>      values (<cfqueryparam cfsqltype="cf_sql_varchar" value="#
> photolist.name#">,
>             <cfqueryparam cfsqltype="cf_sql_varchar" value="#listfirst(
> photolist.name, '_')#">)
>
> .... to allow the query to skip duplicates and continue to execute?
>
> <pseudocode>
>
>        and if you find a duplicate value, just skip it, and go on to the
> next value
>
> </pseudocode>
>
>
>
> > -----Original Message-----
> > From: Dave Watts [mailto:[EMAIL PROTECTED]
> > Sent: Friday, May 16, 2008 11:19 AM
> > To: CF-Talk
> > Subject: RE: What's wrong with this query?
> >
> > > Not being so well-versed in indexing (just starting using
> > > those in MySQL 5), I don't understand how having a unique
> > > index on the photo_filename column will prevent an insert of
> > > a duplicate value.
> > >
> > > Is that function a part of creating a unique index?  Does it
> > > cause MySQL 5 to screen inserts for duplicates and reject them?
> >
> > Yes. That's why it's called a "unique" index.
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:305446
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to