3 Replies Latest reply on May 22, 2014 4:50 PM by Jeremy Brown

    syntax error at or near "{"

    Jeremy Brown

      I have a seemingly simple SQL code that I have an extract set up on. When I go in to update it with an incremental refresh by date, however, I get the error message "syntax error at or near "{"; Error while executing the query Unable to create extract". Since the extract already exists, it seems that the error is in establishing the incremental refresh.


      There are no { in my SQL code, so where is this error message coming in from? I've scoured the forums and knowledge base, but I can't seem to find anything specific to this error. Google was also no help. I'm using Tableau desktop 8.0.0 and always create extract .tde files from my SQL data pulls.

        • 1. Re: syntax error at or near "{"
          Jeremy Brown

          After playing around with features I was hesitant to try, something worked. I removed my extract without deleting the file. Then I re-extracted with the incremental refresh and it worked!


          By why did it work? What's going on here?

          • 2. Re: syntax error at or near "{"
            Jeremy Brown

            I've been working on this problem for the last week. At first I thought it was because of the extract itself, but quickly learned it wasn't that. Here are some more details about what my problems were:


            I used a WITH clause to reduce the cost of my SQL query. Within this WITH clause was a CASE statement with a list where IP addresses matched a list. I used typical SQL syntax, and this code would work completely fine to build the extract, but would fail upon setup of the incremental refresh. Today I commented out that CASE statement and the incremental refresh worked perfectly fine!


            So rather than setting up a list within a CASE within my WITH clause, I have a lengthy CASE with a bunch of WHEN conditions that each equal one of the previous list items.


            If you are experiencing issues with a curly bracket that's not there, odds are that it's because Tableau is adding this bracket around you code for its purposes. There seems to be a limit to how many layers/levels of brackets of any kind there can be and lists could be the problem.

            • 3. Re: syntax error at or near "{"
              Jeremy Brown

              Or apparently comments of any kind... that seems to also prevent the extract from working, too.