Status/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Adam Cameron / Adam Cameron (Adam Cameron)
Created: 03/23/2012
Components: Database, Query-of-Query(IMQ)
Versions: 10.0
Failure Type:
Found In Build/Fixed In Build: 9.0 / 287558
Priority/Frequency: Major / Some users will encounter
Locale/System: English / Win XP All
Vote Count: 0
G'day:
What do you make of this:
[code]
<cfflush>
<cfset qBase = queryNew("")>
<cfset queryAddColumn(qBase, "myCol", "Double", [1,2.5,3.25])>
<cftry>
<cfquery name="qAvg" dbtype="query">
SELECT AVG(myCol) AS avgMyCol
FROM qBase
</cfquery>
<cfdump var="#variables#">
<cfcatch>
<cfdump var="#getMetadata(qBase)#"><!---says the myCol column is a DOUBLE --->
<cfrethrow>
</cfcatch>
</cftry>
[/code]
Yields:
[quote]
Error casting an object of type java.lang.String cannot be cast to java.lang.Number to an incompatible type. This usually indicates a programming error in Java, although it could also mean you have tried to use a foreign object in a different way than it was designed.
java.lang.String cannot be cast to java.lang.Number
[/quote]
However the getMetadata() call yields this:
[quote]
1
struct
IsCaseSensitive NO
Name myCol
[color=red]TypeName DOUBLE[/color]
[/quote]
So:
a) why the error?
b) read the error message carefully:
[quote]
Error casting an object of type java.lang.String cannot be cast to java.lang.Number to an incompatible type.
[/quote]
Err... that's not English.
In case someone is wondering... yep, it's the same on CF9 and CF10.
--
Adam
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3146604
Deployment Phase: Release Candidate
External Customer Info:
External Company:
External Customer Name: Adam Cameron.
External Customer Email:
External Test Config: My Hardware and Environment details:
Attachments:
Comments: