Hello All,
I am using soundings survey tool in my cold fusion application with Oracle Database connection, i was trying to add Multiple Choice Questions Answers in survey tool with oracle data connection.
only first answer is storing in my database, multiple answers are not adding in my database table(ANSWERS).
this is working with mysql database.
please see my questions.cfc
addAnswers function code
<cfargument name="questionidfk" type="uuid" required="true" hint="Related question.">
<cfargument name="answers" type="array" required="true" hint="Array of answer structs">
<cfset var x = "">
<cfloop index="x" from="1" to="#arrayLen(arguments.answers)#">
<cfif structKeyExists(arguments.answers[x],"answer") and
structKeyExists(arguments.answers[x],"rank")>
<cfquery datasource="#variables.dsn#">
insert into #variables.tableprefix#answers(id, questionidfk, answer, rank)
values(<cfqueryparam value="#createUUID()#" cfsqltype="CF_SQL_VARCHAR" maxlength="35">,
<cfqueryparam value="#arguments.questionidfk#" cfsqltype="CF_SQL_VARCHAR" maxlength="35">,
<cfqueryparam value="#arguments.answers[x].answer#" cfsqltype="CF_SQL_VARCHAR" maxlength="255">,
<cfqueryparam value="#arguments.answers[x].rank#" cfsqltype="CF_SQL_INTEGER">)
</cfquery>
</cfif>
</cfloop>
Pleas check above code and let me.
Thanks
ARK
