Skip to main content
lovewebdev
Inspiring
February 7, 2009
Question

cf_sql_integer vs cf_sql_bigint vs cf_sql_int??

  • February 7, 2009
  • 2 replies
  • 5626 views
I have an ID (primary key) set as a BIGINT in SQL SERVER. I have a query with the following:

WHERE whateverid = <cfqueryparam cfsqltype="cf_sql_integer" value="#URL.id#">

I then got an invalid data type for it. I then tried:

WHERE whateverid = <cfqueryparam cfsqltype="cf_sql_bigint" value="#URL.id#">

I still got an invalid data type for it. i then tried:

WHERE whateverid = <cfqueryparam cfsqltype="cf_sql_int" value="#URL.id#">

and it worked.

The weird thing is cf_sql_int is not even listed as being accepted:
http://www.adobe.com/livedocs/coldfusion/5.0/CFML_Reference/Tags79.htm

Can some explain this to me.
This topic has been closed for replies.

2 replies

James Moberg
Inspiring
May 18, 2021

FYI: "CF_SQL_INT" now throws an error with CF2016u17+, CF2018 and CF2021.

Inspiring
February 8, 2009
> WHERE whateverid = <cfqueryparam cfsqltype="cf_sql_bigint" value="#URL.id#">

What is the value of #url.id#? I had no problems with either using CF8.

> The weird thing is cf_sql_int is not even listed as being accepted:

IIRC, when you pass in an invalid sql type CF just uses the default: cf_sql_char, which accepts just about anything. MS SQL probably does an implicit convert() to the right type and that is why it works.
lovewebdev
Inspiring
February 8, 2009
The number was like 200 something? I thought BIGINT covered the same as INT but just more.
Inspiring
February 8, 2009
Yes, bigint can handle 64 bit and integer 32 bit. I had no problems with either using CF8 and the built in driver. Assuming your setup is the same, my guess would be the value as the most likely cause of the problem.

http://msdn.microsoft.com/en-us/library/ms378715(SQL.90).aspx