Skip to main content
November 7, 2008
Answered

Query of Query count(column) returns blank not zero

  • November 7, 2008
  • 5 replies
  • 1237 views
This appears to be a bug in 7,0,1,116466 and 8,0,1,195765

Query of Query count(column) or count(*) returns blank not zero when there are no matches. Properly returns a number when there are query matches.

e.g. select count(i_id) from PersonnelQuery where i_id < 100

Where does one report these?
This topic has been closed for replies.
Correct answer JR__Bob__Dobbs-qSBHQ2
scottcook,

This was a known bug in ColdFusion 6.x which has apparently not been fixed.

Bug in CF6 (See the Comments section of the page linked below)
http://livedocs.adobe.com/coldfusion/6.1/htmldocs/using_29.htm

Workaround
http://www.bennadel.com/blog/244-ColdFusion-Query-Of-Queries-Odd-COUNT-Behavior.htm

To report this as a bug
http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform

5 replies

Inspiring
November 10, 2008
> This appears to be a bug.

Yep.

> Query of Query count(column) returns blank not zero when there are no matches.
> With matches works fine.
>
> e.g. select count(i_id) from PersonnelQuery where i_id < 100
>
> Where does one report these?

Just FYI... I've made sure the Adobe bods on the CF9 programme are aware of
this. UInfortunately I cannot relay back what action is being taken, or
even *if* any action is being taken (I've signed the usual NDA carry-on),
but they're aware of it.

Cheers for bringing this up.

--
Adam
November 7, 2008
Azadi, yes, thanks for the link. I logged it. It has to be such a simple fix I can't believe that it's been years.

Bob - my workaround was probably less annoying to do. I do a select of any column and then used QofQ.RecordCount instead of the QofQ.countqueryvariable
Inspiring
November 7, 2008
didn;t mean to be rude at all. and i did provide a link to report it.

on a second thought, it is a bit strange, but then cf QoQ's support only
limited SQL...

no, you are right, i would expect that QoQ to return a row, too...


Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
November 7, 2008
Thank you for your quick rude response. They are not nulls. Did I say nulls? I said no records match the query. That results in a zero in every database I've used in the last 25 years. So are you still telling me this is normal query behavior?
JR__Bob__Dobbs-qSBHQ2Correct answer
Inspiring
November 7, 2008
scottcook,

This was a known bug in ColdFusion 6.x which has apparently not been fixed.

Bug in CF6 (See the Comments section of the page linked below)
http://livedocs.adobe.com/coldfusion/6.1/htmldocs/using_29.htm

Workaround
http://www.bennadel.com/blog/244-ColdFusion-Query-Of-Queries-Odd-COUNT-Behavior.htm

To report this as a bug
http://www.adobe.com/cfusion/mmform/index.cfm?name=wishform
Inspiring
November 7, 2008
report what? normal query behaviour? no matter how many NULLs you count
the result will still be... NULL!

you can do a QoQ recordcount check before processing results of your QoQ
to make sure it has actually returned a result.

but if your sure you want to report this, go to
http://www.adobe.com/go/wish/


Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/