• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

IsQuery

Explorer ,
Jan 03, 2013 Jan 03, 2013

Copy link to clipboard

Copied

This question was posted in response to the following article: http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7fa9.html

Views

514

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 03, 2013 Jan 03, 2013

Copy link to clipboard

Copied

IsQuery will return true even if there are zero records in the record count.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 03, 2013 Jan 03, 2013

Copy link to clipboard

Copied

Yes, all IsQuery does is check to see if the object is a query, or not (boolean).  Even if there are no records returned, a query is still a query.

If you want to check to see if a query has more than 0 records in it, use <cfif queryName.recordCount gt 0></cfif>

^_^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 04, 2013 Jan 04, 2013

Copy link to clipboard

Copied

LATEST

mrs_temple wrote:

IsQuery will return true even if there are zero records in the record count.

It is not the records which make a query a query. It is the two-dimenstional structure which ColdFusion creates to hold the records. To compare, an empty HTML table is still a a table.

Use the test:

if isQuery(myQuery) and myQuery.recordcount gt 0

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation