Try this (EXISTS checks needs to be tested against returned results):

insert into htmls_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 not exists(select 1 from htmls_photo where photo_filename =
'#photolist.name#')

-KJ

On Fri, May 16, 2008 at 11:54 AM, Rick Faircloth
<[EMAIL PROTECTED]> wrote:
> I tried this but still get a syntax error...
>
> insert into hmls_photos
>            (photo_filename, photo_mls_number)
>     select photo_filename
>       from dual
>      where
>  not exists #photolist.name#
>     values (<cfqueryparam cfsqltype="cf_sql_varchar" 
> value="#photolist.name#">,
>             <cfqueryparam cfsqltype="cf_sql_varchar" 
> value="#listfirst(photolist.name, '_')#">)
>
>
>
>> -----Original Message-----
>> From: Aaron Rouse [mailto:[EMAIL PROTECTED]
>> Sent: Friday, May 16, 2008 11:33 AM
>> To: CF-Talk
>> Subject: Re: What's wrong with this query?
>>
>> 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
>>
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:305457
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