Skip to main content
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 eTable] Set tField] = "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 UTableName] set eSector Lat Valid] = case when eRBS 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?
Hi,

 

 

Try using single quotations '<value>' instead of double quotations "<value>".

 

 

Takashi
Unfortunately I get the same error whether I use single or double quotations.
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 "u ... ]", 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.

 

 

David
Perfect! Worked like a charm! Thanks!

Reply