I'm getting my query output in modal and handler but when it comes to view it is saying
can't cast complex object type query :string
in my coldbox
I'm getting my query output in modal and handler but when it comes to view it is saying
can't cast complex object type query :string
in my coldbox
I assume you are trying to print something. The error is because to you can't print complex objects (query,structure,array, etc..) like that. So you have print it as #yourQueryName.columnName#
. You can dump a complex object, but can't print it.
For example.
<cfset myQry = queryNew("Name,Age","varchar,integer",[{name='kannan',age="29"}])>
Now you can print the query data like
<cfoutput>MyName: #myQry.name# <br/>
MyAge: #myQry.age#<br/>
</cfoutput>
But you can't directly print #myQry#
or it will return the error you're seeing. Instead, you can dump the query like this <cfdump var="#myQry#" />
.
Hopefully that will help you.