I have an insert statement with a dynamic variable that I can
not get to work. The dynamic variable is the form.judge_first_name.
Here is what I have so far: The judge_first_name field
actually is going to have a number at the end of the name after
each time though the loop. I want to reflect that in the insert
statement.
<cfset num = form.number_of_elements>
<cfloop index="h" from="1" to="#num#">
<cfparam name="form.judge_first_name#h#" default=""
type="any">
<cfquery name="insert_judge_first_name"
datasource="#Application.DSN#">
INSERT INTO JUDICIAL_DIVERSITY_JUDGE (judgeid, stateid,
judge_add_date, judge_first_name)
Values((#nextvalue#,
<cfqueryparam value="#form.stateid#"
CFSQLType="CF_SQL_VARCHAR" maxlength="100">, sysdate,
<cfqueryparam value="#form.judge_first_name##h#"
CFSQLType="CF_SQL_VARCHAR" maxlength="1000">)
</cfquery>