Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / May 2007



Tip: Looking for answers? Try searching our database.

cfloop error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Exmachin4 - 30 May 2007 22:41 GMT
Ive never used cfloop like this before i followed advice from another member of
this forum and got this error.
This is an edit function with a drop down. if the user selects  Acid and then
edits it the menu reverts to the first thing in the list not the one they had
previously selected.

The error:

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.
The most likely cause of the error is that you are trying to use a complex
value as a simple one. For example, you might be trying to use a query variable
in a <CFIF> tag. This was possible in ColdFusion 2.0 but creates an error in
later versions.
 

The Code

The drop down menu query
<cfinvoke component="0-waste.sitewisecfc.getcategory"
 method="getCategory" returnvariable="qry_getCategory">
</cfinvoke>

<cfquery name="GetPollutant" datasource="#db#">
    SELECT *
    FROM tblPollutant
    WHERE StoryID = #StoryID# AND EBID = #EBID#
</cfquery>

    <select name="EBCategory">
        <cfloop query="qry_getCategory">
            <option value="#industry_id#" <cfif #Getpollutant.EBCategory# EQ
#qry_getCategory#>
            selected</cfif>>#pollutant_type#</option>
        </cfloop>
    </select>

Any ideas?
cf_dev2 - 30 May 2007 22:54 GMT
You're trying to compare a simple value to a query object:  #qry_getCategory#.  Try adding the column name

<cfif Getpollutant.EBCategory EQ qry_getCategory.SomeColumnName >
....
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.