Proper way to add value to Column
Copy link to clipboard
Copied
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>Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
If your cfif returns true, you are missing a comma.

