Question
Index Looping in a Query ...
All,
I am trying use the index of a cfloop to structure a query, but can not get it to work. Here is the code:
<cftransaction>
<cfquery datasource="#ds#" name="newServices">
INSERT INTO ii_services
VALUES
(#Form.TID#,#Form.pocID#
<cfloop index="i" from="1" to="30">
,
'#Form.service##i#',
'#Form.recDate##i#',
'#Form.included##i#',
'#Form.incDate##i#',
'#Form.status##i#',
'#Form.statDate##i#',
'#Form.negImpact##i#',
'#Form.comment##i#'
</cfloop>)
</cfquery>
</cftransaction>
I have 30 values for service, recdate, etc. that I would like to load, but receive a "Element SERVICE is undefined in FORM" error when it is executed. Can someone point me in the right direction?
Thanks!
I am trying use the index of a cfloop to structure a query, but can not get it to work. Here is the code:
<cftransaction>
<cfquery datasource="#ds#" name="newServices">
INSERT INTO ii_services
VALUES
(#Form.TID#,#Form.pocID#
<cfloop index="i" from="1" to="30">
,
'#Form.service##i#',
'#Form.recDate##i#',
'#Form.included##i#',
'#Form.incDate##i#',
'#Form.status##i#',
'#Form.statDate##i#',
'#Form.negImpact##i#',
'#Form.comment##i#'
</cfloop>)
</cfquery>
</cftransaction>
I have 30 values for service, recdate, etc. that I would like to load, but receive a "Element SERVICE is undefined in FORM" error when it is executed. Can someone point me in the right direction?
Thanks!