Next Page


Previous Page

Thread: Multiple Choice Questions Answers not adding in our oracle database

Created on: 07/20/09 11:19 AM

Replies: 0



Joined: 06/11/09

Posts: 31

Multiple Choice Questions Answers not adding in our oracle database
07/20/09 11:19 AM

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
<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">)

Pleas check above code and let me.


Link | Top | Bottom

Next Page


Previous Page

New Post

Please login to post a response.