4 Replies Latest reply on Oct 12, 2007 9:38 PM by cf_dev2

    Q of Q question

    Level 7
      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
      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">
      url=" http://www.bpoprosonline.com/assets/property/residential/#files.FileName#"
      method="GET" name="Res#i#"
      delimiter="|" textqualifier="" firstrowasheaders="yes" />
      <cfset i = i + 1>
      <cfquery name="JoinedRes" dbtype="query">
      SELECT * From Res1
      <cfif isDefined('Res2')>
      Select * From Res2
      <cfif isDefined('Res3')>
      Select * From Res3
      <cfif isDefined('Res4')>
      Select * From Res4
      <cfif isDefined('Res5')>
      Select * From Res5
      <cfif isDefined('Res6')>
      Select * From Res6
      <cfif isDefined('Res7')>
      Select * From Res7
      ORDER BY City ASC
      <cfreturn JoinedRes>

      <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
      <cfreturn ourListedProps>

      Wally Kolcz
      Founder / Developer