>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