11 Replies Latest reply on Jan 13, 2009 7:40 AM by -==cfSearching==-

    cfloop inside cfoutput

    kel45 Level 1
      Hi i have a cfloop inside a cfoutput query and i am getting the error below, not sure why?

      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.

      <cfstoredproc procedure="GroupSelect" datasource="#application.ds#">
      <cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" dbvarname="ClubLogin" value="1" null="No">
      <cfprocresult name="qGroupSelect" resultset="1">
      </cfstoredproc>

      <cfoutput query="qGroupSelect">
      <a href="Test.cfm?Id=#GroupId#">#GroupId#</a><br>
      <cfif isdefined("url.Id") AND #url.Id# eq #GroupId#>
      <cfstoredproc procedure="GetPlayersByGroupId" datasource="#application.ds#">
      <cfprocparam type="In" cfsqltype="CF_SQL_VARCHAR" dbvarname="GroupId" value="#url.Id#" null="No">
      <cfprocresult name="qGetPlayers" resultset="1">
      </cfstoredproc>

      <cfloop query="#qGetPlayers#">
      #qGetPlayers.FirstName#<br>
      </cfloop>
      </cfif>
      </cfoutput>