Calling Array Functions on ColdFusion Query Columns Part II

Posted July 26, 2006 at 9:04 AM by Ben Nadel

Tags: ColdFusion

The other day I had mentioned that someone posted a great tip about running ColdFusion array functions on query columns. After some testing I had come across the fact that column notation made a huge difference. For example,

  • <cfset flSum = ArraySum( qGirls[ "weight" ] ) />

... works, but the following,

  • <cfset flSum = ArraySum( qGirls.weight ) />

... throws an error. To investigate, I tried dumping out the Java classes that were representing these objects underneath:

  • <!--- Dump out java class name. --->
  • <cfdump var="#qGirls.weight.GetClass().ToString()#" />
  •  
  • <!--- Dump out java class name. --->
  • <cfdump var="#qGirls[ 'weight' ].GetClass().ToString()#" />

It turns out that both of these ColdFusion objects are the java class "coldfusion.sql.QueryColumn". This means that on the Java side of the universe they are the same object. I don't understand exactly how ColdFusion is built on top of Java, but I guess the problem here lies in ColdFusion, before anything gets cast to Java? No idea.




Reader Comments

There are no comments posted for this web log entry.

Post A Comment

Comment Etiquette: Please do not post spam. Please keep the comments on-topic. Please do not post unrelated questions or large chunks of code. And, above all, please be nice to each other - we're trying to have a good conversation here.

Please review the following issues:

Author Name:


Author Email:

Author Website:

Comment:

Supported HTML tags for formatting: <strong>bold</strong>   <em>italic</em>   <code>code</code>







  • Help Wanted - Find Your Next ColdFusion Job
Ben Nadel's Company - Epicenter Consulting Recent Blog Comments
Jun 20, 2013 at 6:56 AM
Experimenting With The Amazon Simple Storage Service (S3) API Using ColdFusion
" Meaning, if I PUT an object into S3, can I (as the PUT executer) read that object from S3 immediately? " "It depends" : http://aws.amazon.com/s3/faqs/#What_data_consistency_mo ... read »
Jun 20, 2013 at 3:15 AM
A Billion Wicked Thoughts By Ogi Ogas And Sai Gaddam
nice post i love it thanks 4 u :) ... read »
seb
Jun 20, 2013 at 2:32 AM
Working With Inherited Collections In AngularJS
@mike, @ben, The best article about scope and prototypal prototypical inheritance in angularjs is http://stackoverflow.com/questions/14049480/what-are-the-nuances-of-scope-prototypal-prototypical- ... read »
Jun 20, 2013 at 2:17 AM
ColdFusion NumberFormat() Exploration
Nice read thanks Ben, Is there a way to mask a negative number? Long story short in the finance sector when you go 'short' on a stock you want the price to fall this is a good thing because you are ... read »
Jun 20, 2013 at 1:09 AM
The Beauty Of The jQuery Each() Method
my html code : <html> <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="nss.js"> ... read »
Jun 19, 2013 at 11:31 PM
Directive Link, $observe, And $watch Functions Execute Inside An AngularJS Context
@Ben, bunch to learn indeed, but thats fun part : ) ... read »
Jun 19, 2013 at 10:41 PM
Referencing ColdFusion Query Columns In A Loop Using Both Array And Dot Notation
Burdock-roots Are you going fat day by day? You need to be good for your family and make some money too. So we bring for you a best product that helps you to be more energetic every day. You will b ... read »
Jun 19, 2013 at 9:52 PM
Working With Inherited Collections In AngularJS
I recognize the applicability of your solution, and how easy it makes to share data across multiple views or even "submodules" of rather simple application. But it seems to me that it creat ... read »
InVision App - Prototyping Made Beautiful With Prototyping Tools