I think Charlie's post about adding the row number [1] to your function when you're creating the struct may close the hole back up. Did you give that a whirl?
-- Josh ----- Original Message ----- From: "Daniel Short" <[EMAIL PROTECTED]> To: "CF-Talk" <cf-talk@houseoffusion.com> Sent: Thursday, January 04, 2007 2:46 PM Subject: Re: Issue with "not of type numeric" when sending value to CFC > Well Josh, it's time to get your space helmet, because indeed there is a > gaping hole (as best I can tell anyway) :). My sample code defines a > recordset with just a single row, with a type of numeric, and a valid > value. > > After all, here's my test code: > > > <!--- Get a query ---> > <cfset rs = QueryNew("ID,FirstName", "integer,varchar") /> > <cfset QueryAddRow(rs) /> > <cfset QuerySetCell(rs, "ID", 3) /> > <cfset QuerySetCell(rs, "FirstName", "Daniel") /> > > <cfset TestStruct = StructNew() /> > <cfloop list="#rs.ColumnList#" index="col"> > <cfset TestStruct[col] = rs[col] /> > </cfloop> > > <cfdump var="#TestStruct#" /> > > <!--- Pass the newly created struct into the object to run each > setter ---> > <cfset MyObject = CreateObject("component", > "cfcs.test").init(ArgumentCollection = TestStruct) /> > > <cfdump var="#MyObject.getSnapShot()#" /> > > As you can see, I'm generating a super simply query, and then passing it > into the object, and somewhere along the line CF is getting completely > confused about the type... > > Dan > > > On 1/4/07 4:39 PM, "Josh Nathanson" <[EMAIL PROTECTED]> wrote: > >> I've only gotten this error when I've accidentally passed a null value >> (for >> example the query returned empty) and it's expecting a numeric. >> >> Make sure that when you're initially building the structure from the >> query, >> that you're indeed passing in all the values you expect, by dumping the >> query before you convert it into a struct. Then, after conversion into >> the >> struct, dump the struct as well to make sure it's still the right value. >> >> I'd be surprised if it was actually failing on a numeric value. This >> would >> open a hole in the time-space continuum. >> >> -- Josh >> >> ----- Original Message ----- >> From: "Daniel Short" <[EMAIL PROTECTED]> >> To: "CF-Talk" <cf-talk@houseoffusion.com> >> Sent: Thursday, January 04, 2007 2:23 PM >> Subject: Issue with "not of type numeric" when sending value to CFC >> >> >>> Hi, >>> >>> I have a blog post which details my problem here: >>> >>> http://www.dansshorts.com/?day=1/4/2007#blog360 >>> >>> What's happening is that if I take a recordset row, and build a >>> structure >>> based on it's columns, and then pass that structure as an >>> ArgumentCollection >>> to a CFC, the method tosses a "not of type numeric" on a value that is >>> indeed numeric. >>> >>> Has anyone else seen a problem like this? The only way around it has >>> been >>> to >>> set the type to "any" and then just accept any old crap that someone >>> wants >>> to pass in. >>> >>> Thanks, >>> >>> -- >>> Daniel Short >>> Web Application Architect >>> lynda.com, Inc. >>> >>> >>> >>> >> >> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:265716 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4