Link to home
Start Free TrialLog in
Avatar of Andrew Angell
Andrew AngellFlag for United States of America

asked on

How to avoid a syntax error on this UPDATE statement..??

I'm running the following SQL statement and I'm getting a syntax error...

UPDATE Global_Response_Fields SET Timestamp='2011-10-22T08:50:34Z', CorrelationID='f1833aed8eeef'

If I remove the Timestamp value from the update then it works fine, but I'm not sure what about that value is causing me a problem or how to fix it..??  It's just a regular text field that I'm trying to add that string of text into.

Any information on how I can fix this would be greatly appreciated.  Thanks!
Avatar of Gerwin Jansen
Gerwin Jansen
Flag of Netherlands image

I don't see a table in your update statement?

What do you get when you do:
select Global_Response_Fields, Timestamp from <tablename> where CorrelationID='f1833aed8eeef'

Open in new window

Avatar of Andrew Angell

ASKER

It's not a SELECT statement, it's an UPDATE statement.  The table name is Global_Response_Fields
UPDATE Global_Response_Fields SET Timestamp=now() , CorrelationID='f1833aed8eeef'
Actually you do not even need to update the timestamp...

It will be updated automatically

UPDATE Global_Response_Fields SET CorrelationID='f1833aed8eeef'
What do you want to update then? Only the CorrelationID field for all records in the table? How is your Timestamp field defined?

ASKER CERTIFIED SOLUTION
Avatar of G_H
G_H
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The value is a string that comes back from the web service I'm working with.  I can't just use a local timestamp.  I need it to match what the service actually gives me for logging purposes.

I can try changing the name to see if the field name itself is causing the issue.  I'll give that a shot and come back to update in a bit.
It was indeed the use of a field called Timestamp that was causing my problem.