Skip to content


Invalid Column Name

Brian asked 2 years ago
I have a map that integrates GL journal entries.  I am grouping the source records by BatchID.  I want to update all records in the source table for the batch if the batch successfully integrates. 
I have a SQL task to runs when the document succeeds to update the source records.
Update tablename set IsIntegrated where BatchID=_BatchID
I am receiving an error Task xxxxx failed.  Document run will continue.  Invalid column name ‘MyBatch’.  
If I modify the statement to
Update tablename set IsIntegrated where RecID=_RecID, the task executes successfully and only the first record in the batch series is updated in the source table.
Why am I receiving the error when using _BatchID variable?
Patrick Roth Staff answered 2 years ago
Running a SQL Profile trace would show this more clearly on the “why”.
But your issue is that while SC is going to replace the _BatchID variable for you just fine (and you know it is since it says MyBatch in the error)
Your issue is that your SQL Syntax is wrong.
SC doesn’t “fix” any SQL it only replaces the variables.  And for a string, you need single quotes around the field
where BatchID = ‘_BatchID’

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