thanks, this solution worked great and is now processing at a steady 2 seconds




> Hey, maybe try something like this?  I haven't tested this, but it 
> should theoretically be faster
> 
> <cfset sqlstring = "" />
> <cfset questionIDLen = arrayLen(questionIDArray)><!---put this in a 
> variable so it doesn't re-evaluate 2200 times--->
> <cfset questionIDCheck = 0>
> <cfloop index="i" from="2" to="#questionIDLen#">
 
> <!---remove "if" statement so it doesn't evaluate 2200 times either.
> --->
 
> <cfset questionIDCheck = isNumeric(questionIDArray[i] & 
> parentQuestionIDArray[i] & parentLevelArray[i])><!---since all your 
> params were checking for a numeric value, lump together and be sure 
> they are all numeric.  probably could use a regEx or other cffunctions 
> to accomplish the same thing if this does not fit the bill--->
 
> <cfif questionIDCheck><!---only add to sql string if it passes the 
> numeric check. --->
  
> <cfset sqlstring = '#sqlstring#,(#questionIDArray[i]#,
> #parentQuestionIDArray[i]#,#parentLevelArray[i]#)'>
 
> </cfif>
> </cfloop>
> <!---run query.  manually add first line since we didn't loop over it.
> --->
> <cfquery name="insertData" datasource="dbname" >
> INSERT INTO parentquestions
> VALUES (<cfqueryparam value="#questionIDArray[1]#" 
> cfsqltype="cf_sql_bigint" maxlength="20">,<cfqueryparam 
> value="#parentQuestionIDArray[1]#" cfsqltype="cf_sql_bigint" 
> maxlength="20">,<cfqueryparam value="#parentLevelArray[1]#" 
> cfsqltype="cf_sql_bigint" maxlength="20">)
 
> #sqlstring#
> </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:339108
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to