Skip to main content
August 29, 2008
Question

CF8: integer vs. numeric

  • August 29, 2008
  • 13 replies
  • 1211 views
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?
This topic has been closed for replies.

13 replies

Inspiring
September 4, 2008
> So, err: "what are you on about?"
>
> About barking up the wrong tree, Adam. Sorry.

No worries. We've all done that.

--
Adam
BKBK
Community Expert
Community Expert
September 4, 2008
Adam Cameron wrote:
The only post I replied to suggesting that something won't work was Dan's one (I quoted his code 'n'all).

So, err: "what are you on about?"


About me barking up the wrong tree, Adam. Sorry.




Inspiring
September 4, 2008
> > But not really relevant to the post of mine you were replying to.
>
> It is relevant. You said my suggestion was "not likely to help, because the
> error: etc. etc. ".

I didn't make any comment one way or the other on anything you said until I
asked you "what are you on about?".

The only post I replied to suggesting that something won't work was Dan's
one (I quoted his code 'n'all).

So, err: "what are you on about?"

--
Adam
BKBK
Community Expert
Community Expert
September 4, 2008
> But not really relevant to the post of mine you were replying to.

It is relevant. You said my suggestion was "not likely to help, because the error: etc. etc. ".

In fact, I do believe my suggestion is a proper way to approach the problem. It is the responsibility of the caller of a function to check the parameters going into it. If Luscious M validated the parameters as I suggest, the function would be called and the error would not occur.

Inspiring
September 3, 2008
>> What are you on about?
> You should check 'em parameters first before feeding 'em to the function.

Sure. But not really relevant to the post of mine you were replying to.

If you re-read that post of mine you were responding to, you should notice
I was simply pointing out that Dan's approach to debugging it wasn't going
to work because his <cfdump> was *after* where the error would have been
being thrown.

--
Adam
BKBK
Community Expert
Community Expert
September 3, 2008
Adam wrote:
What are you on about?

You should check 'em parameters first before feeding 'em to the function.

September 3, 2008
And....now it's not a problem. At least not on the app that I *need* to be working on right now, and I don't have time to check/fix it elsewhere yet.

I'm unconvinced that the whole thing wasn't a setup issue that's been resolved on that end. I'm also unconvinced that it will remain fixed.

Stay tuned. And thanks for the assistance thus far on our magical mystery tour.
Inspiring
September 3, 2008
>> That's not likely to help, because the error:
>> But I keep getting "The [ARGUMENTNAME] argument passed to the
>> [FUNCTIONNAME]
>> function is not of type numeric. "
>>
>> Will be being raised by the call to the function, so processing will have
>> already halted before it gets into the function code.


> It is the standard parameter-validation formula. You probably missed the gist.
> The function should not be called if either tuseral or tfuseactional is
> non-numeric. It is an example of a precondition.

What are you on about?

--
Adam
BKBK
Community Expert
Community Expert
September 3, 2008
Adam Cameron wrote:

That's not likely to help, because the error:
But I keep getting "The [ARGUMENTNAME] argument passed to the
[FUNCTIONNAME]
function is not of type numeric. "

Will be being raised by the call to the function, so processing will have
already halted before it gets into the function code.


It is the standard parameter-validation formula. You probably missed the gist. The function should not be called if either tuseral or tfuseactional is non-numeric. It is an example of a precondition.

Inspiring
September 2, 2008
> Right after your cfargument tags, add these two lines.
> <cfdump var="#arguments#>
> <cfabort>

That's not likely to help, because the error:
But I keep getting "The [ARGUMENTNAME] argument passed to the
[FUNCTIONNAME]
function is not of type numeric. "

Will be being raised by the call to the function, so processing will have
already halted before it gets into the function code.

But applying a similar idea to the variables scope just before the function
call would work along the same lines.

--
Adam