I think you'd need hash-marks (string delimiters) around photolist.name in the where clause, right?
.... where '#photolist.name#' not in (select photo_filename from htmls_photos) .... -KJ > I don't remember ever running a query like this one, so I'm > not sure it's even a valid approach. > > But, should this run? Or do I need to run a separate query > to the existing photo_filenames from hmls_photos to use as a variable? > > <cfquery name="insert_photo" datasource="c21ar"> > > 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, > '_')#">) > where photolist.name not in > (select photo_filename from hmls_photos) > > </cfquery> > > I'm just checking the table to insure that I'm not already inserting a photo > with > a filename already in the table. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:305420 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4