Skip to main content
August 29, 2008
質問

CF8: integer vs. numeric

  • August 29, 2008
  • 返信数 13.
  • 1211 ビュー
We've just upgraded our dev environment to CF8, and I'm writing a new application based on code we've been using successfully for years. Part of it logs user access level, which is stored as an integer. This integer is passed to a custom function, defined in a CFARGUMENT as "numeric" (because "integer" isn't an option), and then passed to a stored procedure as "cf_sql_integer". The stored procedure declares the variable as an integer.

But I keep getting "The [ARGUMENTNAME] argument passed to the [FUNCTIONNAME] function is not of type numeric. "

I checked existing applications that run fine on CF7 -- and they vomit in this exact same place.

Anyone have any ideas where I should turn?
このトピックへの返信は締め切られました。

返信数 13

Inspiring
September 2, 2008
Right after your cfargument tags, add these two lines.

<cfdump var="#arguments#>
<cfabort>
Does the argument that has to be an integer look like an integer?
BKBK
Community Expert
Community Expert
September 2, 2008
I would replace the last line with the following:

BKBK
Community Expert
Community Expert
August 29, 2008
Suppose userAccessLevel is the variable that you pass to the function. Just before the function call, do the following

<cfif isNumeric("userAccessLevel")>
<!--- code that calls function --->
<cfelse>
userAccessLevel has value <cfoutput>#userAccessLevel#</cfoutput> - not an integer
</cfif>




Inspiring
August 29, 2008
> Anyone have any ideas where I should turn?

Well if you were prepared to post useful information (like *the code*),
then you probably wouldn't need to turn anywhere else: ask here.

--
Adam
September 2, 2008
Thanks, Adam. I was hoping that it might be a well-known issue, and not something weirdly specific to me. I'm attaching a pile of code. I'm piecing the code sequence together from a bunch of different pages, so please bear with me. I'm happy to provide more information if needed.