Skip to content
+1-888-319-3663

COMMUNITY FORUM

SmartConnect Task: Incorrect syntax near '0'

John Ellis asked 2 years ago
Hi:
I have created a “Task that runs if the document fails”.  The Task is “SQL Command”, and below is the T-SQL script.
Even if I strip out that last “and” piece of the where clause, I still receive a message upon running the map saying “Incorrect syntax near ‘0’”.
Any ideas?  Thanks!
UPDATE INTEGRATION..PO SET _FLAG = 2
where INTEGRATION..PO.ORDERID = _ORDERID AND _FLAG = ‘0’
Answers
Lorren Zemke answered 2 years ago
John,
I would suspect that when the _ORDERID is replaced, it causes the syntax error.  You can use Microsoft SQL Profiler to watch the SQL command and see what value is being put into the _ORDERID field.  
You probably want to put single quotes arounce the _ORDERID to make sure it’s treated as a string value.
 

If you would like to submit an answer or comment, please sign in to the eOne portal.