Toggling query metainfo using the CFDUMP tag in ColdFusion

Readability

Toggling query metainfo using the CFDUMP tag in ColdFusion

The fol­low­ing exam­ple shows how you can tog­gle the query metainfo using the <CFDUMP> tag in Cold­Fu­sion by set­ting the Boolean metainfo attribute.


    SELECT a.ARTID, a.ARTNAME, a.DESCRIPTION, a.ISSOLD, m.MEDIATYPE
    FROM ART a, MEDIA m
    WHERE a.MEDIAID = m.MEDIAID
    ORDER BY a.ISSOLD ASC, a.PRICE DESC



And the out­put of the <CFDUMP> tag is as fol­lows:
CFQUERY metainfo=true

If you want to sup­press the query metainfo, you can set the metainfo attribute to false, as seen in the fol­low­ing example:


    SELECT a.ARTID, a.ARTNAME, a.DESCRIPTION, a.ISSOLD, m.MEDIATYPE
    FROM ART a, MEDIA m
    WHERE a.MEDIAID = m.MEDIAID
    ORDER BY a.ISSOLD ASC, a.PRICE DESC



And the out­put of the <CFDUMP> tag is as fol­lows:

The following example shows how you can toggle the query metainfo using the <CFDUMP> tag in ColdFusion by setting the Boolean metainfo attribute.

<cfquery name="getArt" datasource="cfartgallery" maxrows="3">
    SELECT a.ARTID, a.ARTNAME, a.DESCRIPTION, a.ISSOLD, m.MEDIATYPE
    FROM ART a, MEDIA m
    WHERE a.MEDIAID = m.MEDIAID
    ORDER BY a.ISSOLD ASC, a.PRICE DESC
</cfquery>
 
<cfdump var="#getArt#" metainfo="true" label="metainfo=true" />

And the output of the <CFDUMP> tag is as follows:
CFQUERY metainfo=true

If you want to suppress the query metainfo, you can set the metainfo attribute to false, as seen in the following example:

<cfquery name="getArt" datasource="cfartgallery" maxrows="3">
    SELECT a.ARTID, a.ARTNAME, a.DESCRIPTION, a.ISSOLD, m.MEDIATYPE
    FROM ART a, MEDIA m
    WHERE a.MEDIAID = m.MEDIAID
    ORDER BY a.ISSOLD ASC, a.PRICE DESC
</cfquery>
 
<cfdump var="#getArt#" metainfo="false" label="metainfo=false" />

And the output of the <CFDUMP> tag is as follows:

Leave a Reply

Your email address will not be published.