Skip to main content
Inspiring
January 14, 2010
Question

Proper way to add value to Column

  • January 14, 2010
  • 2 replies
  • 545 views

Eg. User chose Important count, I need to increament the value of impCount by 1 into the sql server database.

Doing the below is throwing an error

        <cfquery name="qryUpd" datasource="#dsn#">
             update xxxx
                 set
                     <cfif isdefined("arguments.argtImpCount") and IsValid("Integer",arguments.argtImpCount)#">                      

                        impCount = impCount + 1

                    </cfif>

                  active=1

                WHERE id = <cfqueryparam cfsqltype="cf_sql_integer" value="#argtid#">

            </cfquery>
    This topic has been closed for replies.

    2 replies

    Inspiring
    January 14, 2010

    If your cfif returns true, you are missing a comma. 

    Participating Frequently
    January 14, 2010

    Are you getting a coldfusion error or a database error?  What is the error?  At first glance, it looks like you're missing a comma after impCount = impCount + 1.  Not sure if that's the cause of the error you're getting.