coldfusioncoldfusion-8

CFDump of query column does not display all values


The dumping results for the following QoQ are perfectly fine:

<cfquery datasource = "XX.XX.X.XX" name="master2">
   SELECT  DATE(Timedetail) as FIRSTCONN
           , count(Timedetail) as FIRSTOccurances
           , EVENTS 
   FROM    MyDatabase
   WHERE   EVENTS = "FIRST" GROUP BY FIRSTCONN 
<!--- LIMIT 0,10 --->;
</cfquery> 

<cfdump var="#master2#">

<cfquery dbtype="query" name="detail2">
    SELECT  *
    FROM    master2 
    WHERE   FIRSTCONN  >= <cfqueryparam value="#startdate#" cfsqltype="cf_sql_date"> 
    AND     FIRSTCONN  <  <cfqueryparam value="#enddate#" cfsqltype="cf_sql_date">;
</cfquery>  

Dumping Result: <cfdump var="#detail2#"><cfabort>

However, when I try to use the following check on the QoQ:

 Dumping Result: <cfdump var="#detail2.FIRSTCONN#"><cfabort>

I don't see the full list of FIRSTCONN values. Instead I just see one line:

  Dumping Result: {ts '2013-06-29 00:00:00'}

Ideally I should see the list of all the FIRSTCONN in my browser, shouldn't I?


Solution

  • You are looking at the default behaviour of coldfusion. When you output or dump queryname.fieldname, and don't specify a row number, you get the value from the first row. If you want to see all the rows, your choices are:

    1. Look at the value list
    2. Output/dump the entire query
    3. Do another q of q for just that column and cfdump it.
    4. Use cfoutput with a query attribute and just output that field