CFQuery - metadata

You learn something new everyday! I Just discovered that in Coldfusion 7 you can get query infomation (metadata) by adding result = ‘aVariable’ to the cfquery tag.

for example:



select * from aTable


The resulting dump shows:

CACHED (boolean)
COLUMNLIST (the names of the columns returned)
EXECUTIONTIME (time to execute query ms)
RECORDCOUNT (rows returned)
SQL (the sql that was executed)

I use it mainly to see the sql that is executed from dynamically created sql.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Live
  • Google Bookmarks
  • BlinkList
  • FriendFeed
  • Ping.fm
  • StumbleUpon
  • Technorati
  • Mixx
  • Reddit
  • Blogosphere News
  • Fark
  • Identi.ca
  • LinkedIn
  • Sphinn
  • TwitThis
  • E-mail this story to a friend!
  • Print this article!

Related posts:

  1. SQL - The case for CASE The Transact SQL Case statement is a particularly useful...