- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails
When I try to invoke the getStates method from my cfml page, I get an error message:
<cffunction name="getOffices" access="remote" output="no" returntype="query"> <cfquery name="q"> SELECT "Brisbane" as city, "QLD" as state UNION SELECT "Melbourne" as city, "Vic" as state UNION SELECT "Sydney" as city, "NSW" as state UNION SELECT "Cairns" as city, "QLD" as state UNION SELECT "Geelong" as city, "Vic" as state UNION SELECT "Newcastle" as city, "NSW" as state </cfquery> <cfreturn q> </cffunction> <cffunction name="getStates" access="remote" output="no" returntype="query"> <cfset theQuery = getOffices()> <cfquery dbtype="query" name="q"> SELECT DISTINCT state FROM #theQuery# ORDER BY state </cfquery> <cfreturn q> </cffunction>
Complex object types cannot be converted to simple values. The expression has requested a variable or an intermediate expression result as a simple value. However, the result cannot be converted to a simple value. Simple values are strings, numbers, boolean values, and date/time values. Queries, arrays, and COM objects are examples of complex values.How do I get things to work?
The most likely cause of the error is that you tried to use a complex value as a simple one. For example, you tried to use a query variable in a cfif tag.
|Enhanced Mitigation Experience Toolkit and ColdFusion 10 Enterprise||3||49|
|On Submit return to same spot||7||75|
|Coldfusion session variables in scheduled job||1||232|
|Detect and combat possible robot||7||85|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
12 Experts available now in Live!