Re: Recordcount not working????
What happens when you dump OpenedUpSeats and/or isquery(OpenedUpSeats) ? On Thu, May 19, 2011 at 6:57 AM, Phillip Vector vec...@mostdeadlygame.comwrote: cfquery name=OpenedUpSeats dbtype=ODBC datasource=TrainingBE Select * from OpenedUpSeatsView where account='cfset zz=writeoutput(session.account)' /cfquery cfif OpenedUpSeats.RecordCount First of all.. This isn't my code, so I know it's pretty bad. The Query doesn't error, but when it hits the recordcount, I get the Element RECORDCOUNT is undefined in OPENEDUPSEATS. Huh? Isn't recordcount ALWAYS a part of the query? Any ideas how to fix this? For the record, I've also tried this.. cfquery name=OpenedUpSeats datasource=TrainingBE Select * from OpenedUpSeatsView where account='#session.account#' /cfquery cfdump var=#OpenedUpSeats.RecordCount# and same error. Any ideas? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344647 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Recordcount not working????
What happens when you dump OpenedUpSeats and/or isquery(OpenedUpSeats) ? Variable OPENEDUPSEATS is undefined. But it IS defined.. *pulls hair* ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344648 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Recordcount not working????
On 5/19/2011 7:57 AM, Phillip Vector wrote: cfquery name=OpenedUpSeats dbtype=ODBC datasource=TrainingBE Select * from OpenedUpSeatsView where account='cfset zz=writeoutput(session.account)' /cfquery cfif OpenedUpSeats.RecordCount First of all.. This isn't my code, so I know it's pretty bad. The Query doesn't error, but when it hits the recordcount, I get the Element RECORDCOUNT is undefined in OPENEDUPSEATS. Huh? Isn't recordcount ALWAYS a part of the query? Any ideas how to fix this? For the record, I've also tried this.. cfquery name=OpenedUpSeats datasource=TrainingBE Select * from OpenedUpSeatsView where account='#session.account#' /cfquery cfdump var=#OpenedUpSeats.RecordCount# Run it without the Where clause in the SQL and see what happens. -- LinkedIn: http://www.linkedin.com/pub/8/a4/60 Twitter: http://twitter.com/RogerTheGeek Blog: http://rogerthegeek.wordpress.com/ MissHunt: http://www.misshunt.com/ (Home of the Clean/Dirty Magnet) ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344650 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Recordcount not working????
Can we see more of the code? There's obviously something funny here and we're not able to see it. On Thu, May 19, 2011 at 7:02 AM, Phillip Vector vec...@mostdeadlygame.com wrote: What happens when you dump OpenedUpSeats and/or isquery(OpenedUpSeats) ? Variable OPENEDUPSEATS is undefined. But it IS defined.. *pulls hair* ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344652 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Recordcount not working????
Roger, What happens when you just do cfdump var=#OpenedUpSeats#/ (and what in the ham sandwich is this use of writeoutput()) Mark A. Kruger, MCSE, CFG (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com -Original Message- From: Roger Austin [mailto:raust...@nc.rr.com] Sent: Thursday, May 19, 2011 7:26 AM To: cf-talk Subject: Re: Recordcount not working On 5/19/2011 7:57 AM, Phillip Vector wrote: cfquery name=OpenedUpSeats dbtype=ODBC datasource=TrainingBE Select * from OpenedUpSeatsView where account='cfset zz=writeoutput(session.account)' /cfquery cfif OpenedUpSeats.RecordCount First of all.. This isn't my code, so I know it's pretty bad. The Query doesn't error, but when it hits the recordcount, I get the Element RECORDCOUNT is undefined in OPENEDUPSEATS. Huh? Isn't recordcount ALWAYS a part of the query? Any ideas how to fix this? For the record, I've also tried this.. cfquery name=OpenedUpSeats datasource=TrainingBE Select * from OpenedUpSeatsView where account='#session.account#' /cfquery cfdump var=#OpenedUpSeats.RecordCount# Run it without the Where clause in the SQL and see what happens. -- LinkedIn: http://www.linkedin.com/pub/8/a4/60 Twitter: http://twitter.com/RogerTheGeek Blog: http://rogerthegeek.wordpress.com/ MissHunt: http://www.misshunt.com/ (Home of the Clean/Dirty Magnet) ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344653 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Recordcount not working????
On 5/19/2011 7:57 AM, Phillip Vector wrote: Run it without the Where clause in the SQL and see what happens. cfquery name=OpenedUpSeats dbtype=ODBC datasource=TrainingBE Select * from OpenedUpSeatsView /cfquery cfdump var=#OpenedUpSeats# abort gets me Variable OPENEDUPSEATS is undefined. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344654 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Recordcount not working????
Can we see more of the code? There's obviously something funny here and we're not able to see it. cfif (not isdefined(session.stack)) or (not isdefined(session.stackT)) or (not listlen(session.stack) is listlen(session.stackT)) or (listlen(session.stack) gt 40) cflock scope=SESSION timeout=2cfset session.stack= cfset session.stackt= /cflock /cfif cfset me=CourseCatalog.cfm cfquery name=OpenedUpSeats dbtype=ODBC datasource=TrainingBE Select * from OpenedUpSeatsView /cfquery cfdump var=#OpenedUpSeats# abort That's the code there. I get at the end Variable OPENEDUPSEATS is undefined.. Even when I removed the where, it's still messing up. The view exists. The datasource is correct. I just don't get it. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344659 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Recordcount not working????
The code looks like this: cfdump var=#OpenedUpSeats# abort ? I have never seen code like this ever or that writeoutput() above.. have you tried just cfdump var=#OpenedUpSeats# / cfabort / On Thu, May 19, 2011 at 8:29 AM, Phillip Vector vec...@mostdeadlygame.com wrote: cfdump var=#OpenedUpSeats# abort ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344662 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Recordcount not working????
The code looks like this: cfdump var=#OpenedUpSeats# abort ? I have never seen code like this ever or that writeoutput() above.. have you tried just cfdump var=#OpenedUpSeats# / cfabort / Same result. It's not the closing of the tags that are messing things up. cfdump var=#OpenedUpSeats# abort is a valid tag. :) ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344665 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Recordcount not working????
ah, added in CF9 http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7ef7.html Just to rule everything else out.. Go up to the top of the page and JUST put cfquery name=OpenedUpSeats dbtype=ODBC datasource=TrainingBE Select * from OpenedUpSeatsView /cfquery cfdump var=#OpenedUpSeats# abort And see what happens.. make sure there's not some flow issue On Thu, May 19, 2011 at 8:41 AM, Phillip Vector vec...@mostdeadlygame.com wrote: The code looks like this: cfdump var=#OpenedUpSeats# abort ? I have never seen code like this ever or that writeoutput() above.. have you tried just cfdump var=#OpenedUpSeats# / cfabort / Same result. It's not the closing of the tags that are messing things up. cfdump var=#OpenedUpSeats# abort is a valid tag. :) ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344667 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Recordcount not working????
I've seen this in the past when the request to the DB server just dies for some reason. The DB server may even process and return the request, so it may not be obvious. Make sure the DB is giving a response back. Make sure things like JDBC drivers are up to date. Wil Genovese Sr. Web Application Developer/ Systems Administrator CF Webtools www.cfwebtools.com wilg...@trunkful.com www.trunkful.com On May 19, 2011, at 8:26 AM, Phillip Vector wrote: On 5/19/2011 7:57 AM, Phillip Vector wrote: Run it without the Where clause in the SQL and see what happens. cfquery name=OpenedUpSeats dbtype=ODBC datasource=TrainingBE Select * from OpenedUpSeatsView /cfquery cfdump var=#OpenedUpSeats# abort gets me Variable OPENEDUPSEATS is undefined. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344668 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Recordcount not working????
ah, added in CF9 http://help.adobe.com/en_US/ColdFusion/9. 0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7ef7.html Just to rule everything else out.. Go up to the top of the page and JUST put cfquery name=OpenedUpSeats dbtype=ODBC datasource=TrainingBE Select * from OpenedUpSeatsView /cfquery cfdump var=#OpenedUpSeats# abort And see what happens.. make sure there's not some flow issue Same error. The only thing I can think of is that it's a view and not a table. It still should work though.. Shouldn't it? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344671 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Recordcount not working????
I've seen this in the past when the request to the DB server just dies for some reason. The DB server may even process and return the request, so it may not be obvious. Make sure the DB is giving a response back. It's able to do tables.. I think that it's because it's a view and not a table (though, shouldn't it still pull something up?) Make sure things like JDBC drivers are up to date. They are. All other pages are working. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344672 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Recordcount not working????
Are you under CFMX? Try to remove dbtype=ODBC This is not valid anymore: Deprecated the connectString, dbName, dbServer, provider, providerDSN, and sql attributes, and all values of the dbtype attribute except query. They do not work, and might cause an error, in releases later than ColdFusion 5. http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7fae.html ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344674 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Recordcount not working????
Are you under CFMX? Try to remove dbtype=ODBC This is not valid anymore: Thanks for the tip. Eliminated, but still not working. I changed the query to point to a table and that works fine. It's looking up a view that it does this. I can't find anywhere on the interwebs where the is a difference between querying a view or a table in coldfusion. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344676 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Recordcount not working????
There is no difference: we successfully query SQL Server views all the time in several of our apps. Have you checked the permissions? Could it be that the View doesn't allow the CF service user to SELECT data? From: Phillip Vector vec...@mostdeadlygame.com Sent: Thursday, May 19, 2011 10:12 AM To: cf-talk cf-talk@houseoffusion.com Subject: Re: Recordcount not working Are you under CFMX? Try to remove dbtype=ODBC This is not valid anymore: Thanks for the tip. Eliminated, but still not working. I changed the query to point to a table and that works fine. It's looking up a view that it does this. I can't find anywhere on the interwebs where the is a difference between querying a view or a table in coldfusion. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344677 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Recordcount not working????
There is no difference: we successfully query SQL Server views all the time in several of our apps. Have you checked the permissions? Could it be that the View doesn't allow the CF service user to SELECT data? Thanks.. I will check with our DB admin and see. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344678 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Recordcount not working????
Phillip..I don't think dbtype is supported for anything other than type: query any more. On May 19, 2011 9:34 AM, Phillip Vector vec...@mostdeadlygame.com wrote: On 5/19/2011 7:57 AM, Phillip Vector wrote: Run it without the Where clause in the SQL and see what happens. cfquery name=OpenedUpSeats dbtype=ODBC datasource=TrainingBE Select * from OpenedUpSeatsView /cfquery cfdump var=#OpenedUpSeats# abort gets me Variable OPENEDUPSEATS is undefined. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344685 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Recordcount not working????
Thanks.. I will check with our DB admin and see. Turns out, I didn't have permission for the view. I since got it and he mentioned that the view has no records at all anyway and to just put in a cfset OpenedUpSeats.recordcount = 0 to move past it. So yeah. Still a mystery, but we are moving past and not worrying about it. Thanks for the help people and if you guys can think of anything else, please let me know as I hate having the code that kludgy. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344698 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Recordcount not working????
This sort of makes sense. The DB rejected the request, somewhere in the process the JDBC driver returned nothing or NULL or something not exactly expected and closed the request. CF not getting a result set (not even an empty results set) didn't set the query result set variable. Thus you get an error trying to reference the query. I've seen similar issues like this in the past where the JDBC didn't give CF a response or maybe it was a null response and closed the request. CF continues as if nothing happened and the query variable is never set. Wil Genovese Sr. Web Application Developer/ Systems Administrator CF Webtools www.cfwebtools.com wilg...@trunkful.com www.trunkful.com On May 19, 2011, at 10:45 AM, Phillip Vector wrote: Thanks.. I will check with our DB admin and see. Turns out, I didn't have permission for the view. I since got it and he mentioned that the view has no records at all anyway and to just put in a cfset OpenedUpSeats.recordcount = 0 to move past it. So yeah. Still a mystery, but we are moving past and not worrying about it. Thanks for the help people and if you guys can think of anything else, please let me know as I hate having the code that kludgy. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344699 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Recordcount not working????
You are getting an error somewhere else...open up coursecatalog.cfm and step through it... something is happening before this query. -Mark Mark A. Kruger, MCSE, CFG (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com -Original Message- From: Phillip Vector [mailto:vec...@mostdeadlygame.com] Sent: Thursday, May 19, 2011 8:29 AM To: cf-talk Subject: Re: Recordcount not working Can we see more of the code? There's obviously something funny here and we're not able to see it. cfif (not isdefined(session.stack)) or (not isdefined(session.stackT)) or (not listlen(session.stack) is listlen(session.stackT)) or (listlen(session.stack) gt 40) cflock scope=SESSION timeout=2cfset session.stack= cfset session.stackt= /cflock /cfif cfset me=CourseCatalog.cfm cfquery name=OpenedUpSeats dbtype=ODBC datasource=TrainingBE Select * from OpenedUpSeatsView /cfquery cfdump var=#OpenedUpSeats# abort That's the code there. I get at the end Variable OPENEDUPSEATS is undefined.. Even when I removed the where, it's still messing up. The view exists. The datasource is correct. I just don't get it. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344701 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Recordcount not working????
Wil Genovese wrote: This sort of makes sense. The DB rejected the request, somewhere in the process the JDBC driver returned nothing or NULL or something not exactly expected and closed the request. CF not getting a result set (not even an empty results set) didn't set the query result set variable. Thus you get an error trying to reference the query. I've seen similar issues like this in the past where the JDBC didn't give CF a response or maybe it was a null response and closed the request. CF continues as if nothing happened and the query variable is never set. Specifically, it happens when underlying (Java) code sets something to null. CF doesn't grok that and reports that the variable *containing* the null isn't defined (which is, I suppose, actually correct for some values of correct). You can get the same problem with, for example, trying to access missing values in sparse arrays. cfparam is your friend, with its default set to something appropriate (I have a Java object I treat as an ersatz null). -- Regards, Pete (jQuery-free) Jordan Horus Web Engineering Ltd http://www.webhorus.net/ phone: +44 1482 446471 mobile: +44 7973 725120 ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:344704 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm