Should query be after the cfcatch? The "Duplicate entry" error is still thrown because of the unique index and it doesn't make it past that error before CF halts the process.
I just get the same "HTTP 500 Internal Server Error" in the browser and the "Duplicate entry..." error in the CF app log. > -----Original Message----- > From: Wim Lemmens [mailto:[EMAIL PROTECTED] > Sent: Friday, May 16, 2008 11:41 AM > To: CF-Talk > Subject: Re: What's wrong with this query? > > <cftry> > <cfquery datasource="#request.yourDsn#"> > 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, '_')#">) > </cfquery> > <cfcatch> > <cfif cfcatch.message contains "Duplicate entry"> > <cfoutput><br />Duplicate entry: #photolist.name#</cfoutput> > <cfelse> > <cfrethrow><!--- Not a duplicate entry error, throw error ---> > </cfif> > </cfcatch> > </cftry> > > That should do the trick! > > Wim. > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:305463 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

