Skip to main content
January 13, 2009
Question

cfloop inside cfoutput

  • January 13, 2009
  • 1 reply
  • 2974 views
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>

This topic has been closed for replies.

1 reply

Inspiring
January 13, 2009
kel45 wrote:
> Hi i have a cfloop inside a cfoutput query and i am getting the error below,
> not sure why?

<cfdump> the value to see exactly what type it is (the error says that
you're trying to use a complex object - for example struct, array,
component, etc - in a simple value context - number, string, boolean, etc).

--
Mack
January 13, 2009
i have done a cfdump and a get a row of records which i expect