I should clarify, I'm getting a lower record count than I expect. ie: querylen=5000, arraylen=1537 (or something).
thanks for the replies, simon -----Original Message----- From: Timothy Heald [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 27, 2002 10:12 AM To: CF-Talk Subject: RE: sessionquery.recordcount The only time I have gotten a record count higher than I thought it should be was when I was using aggregate functions. So I would get 1, even if there was really nothing returned (because the result was a 0). Aside from that, what are you doing that requires this? Maybe we could figure out a better way of doing it? Tim -----Original Message----- From: Simon Stanlake [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 27, 2002 1:04 PM To: CF-Talk Subject: sessionquery.recordcount hi, we have the following code... <cfquery name="session.myResults" datasource="#request.ds#"> select * from theTable </cfquery> <!--- create an array of 1's to use in queryAddColumn ---> <cfset defaultValueArray = ArrayNew(1)> <cfloop index="i" from="1" to="#session.myResults.recordCount#"> <cfset defaultValueArray[i] = 1> </cfloop> occasionally, we exit this piece of code and the length of the array is different from the length of the query. ie: arraylen(defaultValueArray) != session.myResults.recordCount. It seems to me that this should never happen. I've changed the name of the table and the session variable, but otherwise the code is a cut-and-paste. I realize there are a bunch of different ways to do this, but I want to know what causes this behaviour. Has anyone else seen something similar? recordcount not always returning the right value? cfloop bailing out early? funniness when storing queries in the session scope? thanks, simon ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm