Re: SQL Azure and Coldfusion 9
Rather that CF9 and CFQUERY handle it better To my mind, if CFQUERY does not error out, then the queryname, recordcount and column list in all cases should be set, regardless of driver or target database. For those of us with sprawling apps to maintain (1,000s of .cfm files) and where a global edit across such code base is not possible, patching this is headache. >So use isDefined(Variables.queryname) first. ~| 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:339642 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: SQL Azure and Coldfusion 9
So use isDefined(Variables.queryname) first. -Original Message- From: Sean Henderson [mailto:shender...@followup.net] Sent: Tuesday, November 30, 2010 4:14 PM To: cf-talk Subject: Re: SQL Azure and Coldfusion 9 >This is actually incredibly easy to deal with this scenario, you just have >to check for the existence of the query variable first. >You would normally check the recordcount > 0 anyway so you don't output >nothing, so it really isn't any more work. That would be true except when recordcount isn't populated, the query itself may not be populated and, depending on why, will error out. Since isQuery() will error out if the var is unset after CFQUERY, that is not very useful either. CFQUERY name="myQry" ... declare @tmp table (col1 int) -- step 1 insert into @tmp (col1) select sub.* from (select 1 as col1 where 1=2) sub -- step 2 select * from @tmp where 1=2 -- step 3 /CFQUERY CFIF isQuery(myQry) CFDUMP var="#myQry#" CFDUMP var="#myQry.recordCount#" CFDUMP var="#myQry.columnlist#" /CFIF This will (still) bomb using MS JDBC 2.0/3.0 drivers against SQL Azure or SQL Server 2008 (SQL2K8). Not so using MS SQL Server (which is actually a MM JDBC driver in CF) against SQL2K8. Sean ~| 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:339640 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: SQL Azure and Coldfusion 9
>This is actually incredibly easy to deal with this scenario, you just have >to check for the existence of the query variable first. >You would normally check the recordcount > 0 anyway so you don't output >nothing, so it really isn't any more work. That would be true except when recordcount isn't populated, the query itself may not be populated and, depending on why, will error out. Since isQuery() will error out if the var is unset after CFQUERY, that is not very useful either. CFQUERY name="myQry" ... declare @tmp table (col1 int) -- step 1 insert into @tmp (col1) select sub.* from (select 1 as col1 where 1=2) sub -- step 2 select * from @tmp where 1=2 -- step 3 /CFQUERY CFIF isQuery(myQry) CFDUMP var="#myQry#" CFDUMP var="#myQry.recordCount#" CFDUMP var="#myQry.columnlist#" /CFIF This will (still) bomb using MS JDBC 2.0/3.0 drivers against SQL Azure or SQL Server 2008 (SQL2K8). Not so using MS SQL Server (which is actually a MM JDBC driver in CF) against SQL2K8. Sean ~| 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:339639 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: SQL Azure and Coldfusion 9
Sean, This is actually incredibly easy to deal with this scenario, you just have to check for the existence of the query variable first. You would normally check the recordcount > 0 anyway so you don't output nothing, so it really isn't any more work. Russ -Original Message- From: Sean Henderson [mailto:shender...@followup.net] Sent: 26 November 2010 17:07 To: cf-talk Subject: SQL Azure and Coldfusion 9 FYI, SQL Azure is not part of the support matrix for ColdFusion. http://www.adobe.com/products/coldfusion/pdfs/cf9_support_matrix_4_ue.pdf There's an issue with SQL Azure where certain types of queries that when returning zero records, will not populate recordcount or set the query variable at all. After contacting Adobe about a patch for this for ColdFusion 9, Adobe indicated that SQL Azure is not supported and closed the support ticket. I have a ticket opon on the Microsoft side, and still trying to identify whether it is the JDBC driver itself or something specific with SQL Azure. For now, if considering SQL Azure, likely not an option for production at this time unless willing to write overly defensive code. ~| 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:339544 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm