Highlighted

Invalid data '' for CFSQLTYPE CF_SQL_INTEGER

New Here ,
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

6.0K

Likes

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

Invalid data '' for CFSQLTYPE CF_SQL_INTEGER

New Here ,
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

6.0K

Likes

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
Apr 24, 2015 0
Advocate ,
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.

Likes

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
Reply
Loading...
Apr 25, 2015 0
Participant ,
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.

Likes

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
Reply
Loading...
May 01, 2015 0
New Here ,
May 02, 2015

Copy link to clipboard

Copied

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.

Likes

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
Reply
Loading...
May 02, 2015 0
Adobe Community Professional ,
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>

Likes

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
Reply
Loading...
May 02, 2015 0
New Here ,
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,

Likes

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
Reply
Loading...
May 02, 2015 0