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

Proper way to add value to Column

Contributor ,
Jan 14, 2010 Jan 14, 2010

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>
518
Translate
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 Beginner ,
Jan 14, 2010 Jan 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.

Translate
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
LEGEND ,
Jan 14, 2010 Jan 14, 2010
LATEST

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

Translate
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