How to set an index of an array within a struct as a variable(Coldfusion) -


this first error getting: invalid data [d6-2014-74, , ] cfsqltype cf_sql_varchar

here corresponding code.

 <cfset x = arguments.surveydocno>  <cfprocparam cfsqltype="cf_sql_varchar" value="#x#"> 

first error image:

to solve problem, changed code this:

 <cfset x = arguments.surveydocno[1]> 

however, returns error:

500 have attempted dereference scalar variable of type class java.lang.string structure members.

error 2

so array issue fixed, don't know how fix second error.

 <cfdump var="#arguments.surveydocno#"> 

enter image description here

i assume pass surveydocno argument string , array of strings.

<!--- if argument passed array, take first element ---> <cfif isarray(arguments.surveydocno) , (not arrayisempty(arguments.surveydocno))>     <cfset x = arguments.surveydocno[1]> <cfelse>     <cfset x = arguments.surveydocno> </cfif>  <!--- if provided argument not string, throw exception ---> <cfif not issimplevalue(x)>     <cfthrow type="illegalargumentexception" message="the provided value argument [surveydocno] invalid. expected string."> </cfif>  <cfprocparam cfsqltype="cf_sql_varchar" value="#x#"> 

Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -