If I have an array, and I want to update a table with those values, How do I
keep the sequence in order? I'm in a loop to create the array, and am trying
to update the table after the array is complete?
<cfscript>
stDownPaymentInfo = StructNew();
stMyDownpayments = StructNew();
stMyDownpayments.aDownpayments = ArrayNew(1);
stDownpaymentInfo.aDownPayments = ArrayNew(1);
</cfscript>
<cfloop index="I"
FROM="1"
TO="#control_suspenseCount#">
<cfscript>
stDownPaymentInfo.AgentState = '#DisplayAgentState#';
stDownPaymentInfo.RegOffice = '#DisplayREgionalOffice#';
stDownPaymentInfo.AgentNumber = '#DisplayAgentNumber#';
stDownPaymentInfo.SuspenseNumber = '#DisplaySuspenseNumber#';
stDownPaymentInfo.Company = '#DisplayCompany#';
stDownPaymentInfo.Policy = '#DisplayPolicyNum#';
stDownPaymentInfo.Amount = '#DisplayAmount#';
ArrayAppend(stMyDownpayments.aDownpayments,StructCopy(stDownpaymentInfo));
</cfscript>
</cfloop>
Update table here with values in above array .
Thanks
NateNielsen - 27 Oct 2004 14:58 GMT
<cfloop from="1" to="#arrayLen(stMyDownpayments.aDownpayments)#" index="i">
<cfquery datasource="#yourDSN#" name="updatePaymentInfo">
...your query here...
to get the value of an element, you'll use the following syntax :
#stMyDownpayments.aDownpayments.AgentState#
#stMyDownpayments.aDownpayments.RegOffice#
#stMyDownpayments.aDownpayments.SuspenseNumber#
...etc.
</cfquery>
</cfloop>
make sense ?
=)
Nate Nielsen
http://www.webclarity.com
adventuregirl - 27 Oct 2004 16:32 GMT
Exellent - I was on the right track but missed one major issue.
Thanks a million!