Skip to main content
Christopher Bowyer
Participant
Dec 23, 2022 4:51 AM UTC
Answered

cfsqltype cf_sql_tinyint Issue

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 is closed to new replies. Start a new post to keep the conversation going.
    BKBK
    BKBKCorrect answer
    Community Expert
    Dec 25, 2022 2:54 PM UTC

    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
    Dec 25, 2022 2:54 PM UTC

    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.

    Translate
    Christopher Bowyer
    Participant
    Dec 23, 2022 4:57 AM UTC

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

    Translate