Hi list, with the following script (below) I am
checking duplicate eMails and I delete
them after checking them.
This script runs ages, when you have more
than a couple of thousand eMails in
your database.
Is there any advice how to tune this up ?
Or is there another script I could use for doing this ?
Uwe
 -------------------------------------------------------------------------
<cfquery name="CheckDups" datasource="something" dbtype="ODBC">
SELECT * FROM blabla
ORDER BY email ASC
</cfquery>

<CFSET zaehler=1>
<CFSET liste_duplikate = "">

<CFLOOP QUERY="DuplikateSuchen" STARTROW="1">
        <CFSET aktuelle_email=trim("#email#")>
        <CFSET zaehler=zaehler+1>
        <CFSET zaehler_innen=zaehler>
        <CFLOOP QUERY="DuplikateSuchen" STARTROW="#zaehler#">

                <CFIF trim(email) is #aktuelle_email#>
                  <CFSET liste_duplikate=ListAppend(liste_duplikate,"#id#")>
                </CFIF>
                <CFSET zaehler_innen=zaehler_innen+1>
        </CFLOOP>
        
<CFIF ListFind(liste_duplikate, trim(#DuplikateSuchen.id#))>

<cfquery name="DuplikateSuppressionzaehlerUpdate" datasource="something" dbtype="ODBC">
delete from siebel
where id = #DuplikateSuchen.id#
</cfquery>

</cfif>

</CFLOOP>

------------------------------------------------------------------------------------

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. 
http://www.fusionauthority.com/ads.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to