Hi, All
I have a unique insert problem with the code below.
This code takes a structure from a parsed xml document, and inserts the values the database. The number of records will always be about 3000. Hence, the loop is placed on the inside the query tag to limit the calls to the database to one call (a performance decision, if you will).
The problem is that record insertion always stalls at 455 records (no error is thrown, though)!
If I place the loop outside the query, this solves the problem, but performance takes a hit from 3000 calls to the database.
I would greatly appreciate any insight to this problem-leaving the loop inside the query.
Technical solution-CF5, SQL Server 7.0
<CFOUTPUT>
<CFSET I=1>
<CFSET END=ArrayLen(structDailyCall.DAILYCALLS.CALLRECORD)>
<CFQUERY NAME="qGet_DailyCalls" DATASOURCE="#DSN#" DBTYPE="ODBC" USERNAME="#UNAME#" PASSWORD="#PW#">
<CFLOOP INDEX="I" FROM="1" TO="#END#" STEP="1">
insert into DailyCalls
(
CallDateTime,
AnsweredDuration
)
values
(
'#TRIM(DateFormat(StructFind(structDailyCall.DAILYCALLS.CALLRECORD.CALLDATETIME, "VALUE"
#TRIM(TimeFormat(StructFind(structDailyCall.DAILYCALLS.CALLRECORD.CALLDATETIME, "VALUE"
#TRIM(StructFind(structDailyCall.DAILYCALLS.CALLRECORD.ANSWEREDDURATION, "VALUE"
)
<CFSET I=I+1>
</CFLOOP>
</CFQUERY>
</CFOUTPUT>