I'm trying to update a value in a field to a new value based on a case statement. I'm using SQL Creator to do this.
I can update a field just fine with Update [Table] Set [Field] = "PASS".
But if I try to set the field equal to a case statement I get an error that says "Provider error `(-2147217900) Syntax error (missing operator) in query expression '(case when".
Here is the exact query I'm using:
Update [TableName] set [Sector Lat Valid] = case when [RBS Lat] is null then "NA" when [RBS Lat]>=0 and [RBS Long]<=90 then "PASS" else "FAIL" end
Does anyone have an idea what I'm doing wrong? Thanks in advance?
Best answer by david_r
Hi,
the syntax of the SQLCreator / SQLExecutor is not specific for FME, it follows the underlying database. So the syntax may be different between Oracle and SQL Server, for example.
Since you're referencing table names using brackes "[ ... ]", I'm suspecting that you're using MS Access? If that is so, Access does not support CASE statements, you will have to translate into an IIF function. See here for a discussion with examples.
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.
the syntax of the SQLCreator / SQLExecutor is not specific for FME, it follows the underlying database. So the syntax may be different between Oracle and SQL Server, for example.
Since you're referencing table names using brackes "[ ... ]", I'm suspecting that you're using MS Access? If that is so, Access does not support CASE statements, you will have to translate into an IIF function. See here for a discussion with examples.
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.