If a simple query works i would be taking stuff out stripping stuff out of
the query and seeing what is making it not return anything and i would be
starting with the HAVING clause. It is possible that there is something in
there that is making it not return anything.

 

Out of curiosity, what happens if you add the "result" attribute into the
query and  dump the result value? What do you get?

 

From: Scott Thornton [mailto:scott.thorn...@hnehealth.nsw.gov.au] 
Sent: Friday, 1 October 2010 10:29 AM
To: cfaussie@googlegroups.com
Subject: RE: [cfaussie] Strange problem - Element RECORDCOUNT is undefined
in query

 

HI All,

 

1. What happens if you try CFDUMP instead right after the query?

 

using

<cfdump var="#fix_this#"><cfabort>

 

returns 

 

Variable FIX_THIS is undefined.

 

2. re recordcount gt 0.

 

I didn't know that, thanks.

 

3.  Why the cfoutput?

 

The original code used cfloop, I tried using cfoutput as well. Typically
cfloop would be used.

 

4. Update CF? 

 

Will try that now.

 

5. Does the query run (as is)?

 

Yes it does, however it does not return any rows ( in SQl Query Analyzer
2000). The database is MS SQL 2005

 

5. Much simplier query?

 

<cfquery  datasource="#DSN#" name="fix_this">

                select top 1 * from sb_invoice

</cfquery>

 

<cfdump var="#fix_this#"><cfabort>

 

works fine.

 

Sooo, I will update my local server first, then put the orginal query back
in and see how it goes.

 

From: cfaussie@googlegroups.com [mailto:cfaus...@googlegroups.com] On Behalf
Of m...@ampersand.net.au
Sent: Friday, 1 October 2010 9:41 AM
To: cfaussie@googlegroups.com
Subject: Re: [cfaussie] Strange problem - Element RECORDCOUNT is undefined
in query

 

What happens if you try CFDUMP instead right after the query?

On 1/10/2010 9:35 AM, Scott Thornton wrote: 

Hi,

 

Running across a odd problem in CF 9,0,0,251028. development server.

 

I was just running a process that usually works and has not been modified
for quite a long time. part of that process runs a query and then loops over
the result set. Simple enough. however the query does not seem to exist
after it has run.

 


eg: The following code returns Element RECORDCOUNT is undefined in FIX_THIS.



 

 

<cfquery  datasource="#DSN#" name="fix_this">

                select sb_invoice.sb_invoice_id,
sb_invoice.sb_reminder_date, max(sb_claim_date) as sb_claim_date

                from sb_invoice

                inner join sb_invoice_item

                on sb_invoice.sb_invoice_id = sb_invoice_item.sb_invoice_id

                inner join sb_item_claim

                on sb_invoice_item.sb_invoice_item_id =
sb_item_claim.sb_invoice_item_id

                where sb_invoice.sb_bill_mech_code in
('M','F','AG','SC','MB','MO')

                and sb_invoice_item.sb_item_status_code in ('21','24','31')

                group by sb_invoice.sb_invoice_id,
sb_invoice.sb_reminder_date

                having sb_invoice.sb_reminder_date <
DateAdd(d,30,max(sb_claim_date))

</cfquery>

 

<cfif fix_this.recordcount gt 0>

 

                <cfoutput query="fix_this">

                

                                <cfquery name="upd_fund_reminder"
datasource="#DSN#">

                                                update sb_invoice

                                                set sb_reminder_date =
<cfqueryparam cfsqltype="cf_sql_varchar"
value="#DateFormat(DateAdd("d",31,fix_this.sb_claim_date),"dd-mmm-yyyy")#">

                                                where sb_invoice_id =
<cfqueryparam cfsqltype="cf_sql_numeric" value="#fix_this.sb_invoice_id#">

                                </cfquery>

                                

                </cfoutput>

 

</cfif>

 

I have changed the name of the query to a few different values, I have used
cfloop instead of cfoutput, I added the cfif.recordcount to see if that
helped, to no avail. Without the CFIF the error was :


Attribute validation error for tag cfoutput. 

 


The value of the attribute query, which is currently fix_this, is invalid. 

 

 

Debug output shows that the query executed in 922ms and returned no rows.

 

What am I missing?

 

-- 
You received this message because you are subscribed to the Google Groups
"cfaussie" group.
To post to this group, send email to cfaus...@googlegroups.com.
To unsubscribe from this group, send email to
cfaussie+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/cfaussie?hl=en.

-- 
You received this message because you are subscribed to the Google Groups
"cfaussie" group.
To post to this group, send email to cfaus...@googlegroups.com.
To unsubscribe from this group, send email to
cfaussie+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/cfaussie?hl=en.

-- 
You received this message because you are subscribed to the Google Groups
"cfaussie" group.
To post to this group, send email to cfaus...@googlegroups.com.
To unsubscribe from this group, send email to
cfaussie+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/cfaussie?hl=en.





=======
Email scanned by PC Tools - No viruses or spyware found.
(Email Guard: 7.0.0.21, Virus/Spyware Database: 6.15990)
http://www.pctools.com <http://www.pctools.com/?cclick=EmailFooterClean_51> 
======= 





=======
Email scanned by PC Tools - No viruses or spyware found.
(Email Guard: 7.0.0.21, Virus/Spyware Database: 6.15990)
http://www.pctools.com/
=======

-- 
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaus...@googlegroups.com.
To unsubscribe from this group, send email to 
cfaussie+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en.

Reply via email to