Could this be combined with an "ELSE" statement in SQL? That is, insert if
new, update if existing? Thanks, Che

-----Original Message-----
This is what I'm using at the moment but I'm going to read what you have as
well. I want fast and safe.

            <cfquery datasource="#variables.dsn#">
                if not exists(
                    Select keywordid
                    from keywords
                    where keyword = <cfqueryparam value="#local.keyword#"
cfsqltype="cf_sql_varchar">)
                    Insert into keywords(keyword)
                    values(<cfqueryparam value="#local.keyword#"
cfsqltype="cf_sql_varchar">)
            </cfquery>




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:341620
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to