<cfif form.custommessage NEQ "">
<cfquery name="Updatestatus" datasource="wweb_status">
Update wweb_status
SET status = 'custom', custom_message = '#form.custommessage#'
Where status = status
</cfquery>
</cfif>
First, you don't need to put #'s inside the <cfif> tag at the top.
Second, you only need to use "SET" once in SQL and then follow that with a
comma-separated list of fields and values to set.
Third, I'm guessing that the "custom_message" field is some type of
character field, which means that you'll need to wrap single quotes around
it.
And finally, reexamine your Where clause to make sure that's really what you
want.
Oh, and I'd be a terrible person if I didn't recommend you to use
<cfqueryparams> in your queries!!
-----Original Message-----
From: Robert Orlini [mailto:[EMAIL PROTECTED]
Sent: Friday, March 12, 2004 2:45 PM
To: CF-Talk
Subject: Incorrect syntax near...
In this SQL script below I get the following error: "Incorrect syntax near
'='." I've tried #form.custommessage# in single quotes, double quotes and no
quotes, but still it won't work though it displays the text in the debug.
This is the error above "ODBC Error Code = 37000 (Syntax error or access
violation)"
It seems simple. Please help.
Robert O.
HWW
<CFif #form.custommessage# NEQ "">
<cfquery name="Updatestatus" datasource="wweb_status">
Update wweb_status
SET status = 'custom'
SET custom_message = #form.custommessage#
Where status = status
</cfquery>
_____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

