I have a function that joins 7 csv files via cfhttp. I want
to be able to
use that master query and search against it.
In another function I attempted to set the value of a
variable to the result
of that fuction and then use QofQ to refine it but I am
getting this error:
Message Complex object types cannot be converted to simple
values.
Detail 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.
I know the JoinRes works but don't know how to set it to a
variable to use
again elsewhere in the web site.
Here are my functions:
<cffunction name="JoinedRes" access="public"
returntype="query"
output="false" hint="I join all the Residentials">
<cfset files = getFileNames('ResFiles')>
<cfset i = 1>
<cfloop query="files">
<cfoutput>
<cfhttp
url="
http://www.bpoprosonline.com/assets/property/residential/#files.FileName#"
method="GET" name="Res#i#"
delimiter="|" textqualifier="" firstrowasheaders="yes" />
</cfoutput>
<cfset i = i + 1>
</cfloop>
<cfquery name="JoinedRes" dbtype="query">
SELECT * From Res1
<cfif isDefined('Res2')>
UNION
Select * From Res2
</cfif>
<cfif isDefined('Res3')>
UNION
Select * From Res3
</cfif>
<cfif isDefined('Res4')>
UNION
Select * From Res4
</cfif>
<cfif isDefined('Res5')>
UNION
Select * From Res5
</cfif>
<cfif isDefined('Res6')>
UNION
Select * From Res6
</cfif>
<cfif isDefined('Res7')>
UNION
Select * From Res7
</cfif>
ORDER BY City ASC
</cfquery>
<cfreturn JoinedRes>
</cffunction>
<cffunction name="ourListedProps" access="public"
returntype="query"
output="false" hint="I return all BPO Pros Property from
MLS">
<cfset residential = JoinedRes()>
<cfquery name="ourListedProps" dbtype="query">
Select
DISTINCT(MLSNumber),PhotoURL,ListPrice,City,ListOfficeId FROM
#residential# WHERE ListOfficeId = 340169
</cfquery>
<cfreturn ourListedProps>
</cffunction>
--
Wally Kolcz
MyNextPet.org
Founder / Developer
586.871.4126