• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Invalid data '' for CFSQLTYPE CF_SQL_INTEGER

New Here ,
Apr 24, 2015 Apr 24, 2015

Copy link to clipboard

Copied

Every time I enter data, I get this error report:

Invalid data '' for CFSQLTYPE CF_SQL_INTEGER

It might be related to this problem:

<cfloop collection="#cities#" item="cityID">

  products["#cityID#"] = [<cfset first = true><cfloop collection="#cities[cityID].products#" item="productID"><cfif first><cfset first = false><cfelse>,</cfif>{value:"#productID#", text:"#cities[cityID].products[productID]#"}</cfloop>];

  </cfloop>

There is a syntax error I cannot find in the line starting with product[

Can anyone help?

Thanks,

Views

9.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Apr 25, 2015 Apr 25, 2015

Copy link to clipboard

Copied

I don't think this error relates to that line of code.

The error you are getting means that you are trying to pass a non integer to a cfqueryparam tag which has the type of integer specified. Which means that this error will be in a "cfquery" tag.

If you log into the coldfusion administrator and look at the logs (Application.log or coldfusion-out.log) it may tell you the line number of the error making it easier to find.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 01, 2015 May 01, 2015

Copy link to clipboard

Copied

If the value you are passing in is empty, and your database column allows nulls, then you might want to look at the "null" attribute of the cfqueryparam tag.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 02, 2015 May 02, 2015

Copy link to clipboard

Copied

LATEST

I have review your answer, and you are absolutely right. I have found that I have a conflict between two programs. One is known as raw_materials_decision_action and the second is raw_materials_decision.

The first one state that the rawMat variable is a money variable, and the second, practically states it as an integer.

Except, that I do not know how to correct the second variable, in spite that I have tried.

Thank you very much.

You were very kind.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 02, 2015 May 02, 2015

Copy link to clipboard

Copied

Rewrite the code in the following way, and you will find that there are quite a few things that don't quite match up:

<cfloop collection="#cities#" item="cityID">

products["#cityID#"] = [

<cfset first = true>

<cfloop collection="#cities[cityID].products#" item="productID">

    <cfif first>

        <cfset first = false>

    <cfelse>

        ,

    </cfif>

    {value:"#productID#", text:"#cities[cityID].products[productID]#"}

</cfloop>

];

</cfloop>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 02, 2015 May 02, 2015

Copy link to clipboard

Copied

Thank you. I have already made the change. I have not been able to know if it will work, because, I have not been able to test the change yet.

But, it appears to be a great improvement.

I appreciate very much your kind assistance,

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation