ColdFusioning.com
Pronunciation \kold-fy-zhn-ing\ Noun: The actions of one that writes ColdFusion.

Please check out my new site: http://ja.mesbrown.com/

ColdFusion 9 Feature: Using cfquery Without a Datasource Specified

Ben Forta gave us a sneak preview into one of the new ColdFusion 9 features. According to his website, You can now use cfquery without a datsource:

view plain print about
1<cfquery name="getTypes">
2SELECT TypeID, Type
3FROM Types
4</cfquery>

As long as you specify a datasource in your Application.cfc file:

view plain print about
1<cfcomponent>
2 <cfset this.datasource="myDataSource">
3</cfcomponent>

This is a great time-saver and especially will allow for increased code sharing between developers and applications. You will be able to drop existing or open-source queries into new applications without having to do a find/replace on the original code to replace the existing datasource.

TweetBacks

Comments

Recent Comments

RSS

Subscribe