Skip to main content
Christopher Bowyer
Participant
December 23, 2022
Answered

cfsqltype cf_sql_tinyint Issue

  • December 23, 2022
  • 2 replies
  • 240 views

Is this a bug?

 

The cfsqltype cf_sql_smallint type doesn't work for any integer under 99, but the cfsqltype cf_sql_smallint does.

 

For example -

 

<cfset cookie.factId = 1>

<cfquery name="factMatchSelect" dbtype="query">
  SELECT
    id
  FROM
    factSelect
  WHERE id = <cfqueryparam value="#cookie.factId#" cfsqltype="cf_sql_tinyint">
</cfquery>

 

    This topic has been closed for replies.
    Correct answer BKBK

    I can imagine why you get an error with TinyInt, but not with SmallInt. I suspect that, under the hood, ColdFusion maps Shorts to SmallInt rather than to TinyInt.

     

    That is quite likely a ColdFusion bug, which I have reported.

    2 replies

    BKBK
    Community Expert
    BKBKCommunity ExpertCorrect answer
    Community Expert
    December 25, 2022

    I can imagine why you get an error with TinyInt, but not with SmallInt. I suspect that, under the hood, ColdFusion maps Shorts to SmallInt rather than to TinyInt.

     

    That is quite likely a ColdFusion bug, which I have reported.

    Christopher Bowyer
    Participant
    December 23, 2022

    I meant, The cfsqltype cf_sql_tinyint type doesn't work...