1 Reply Latest reply on Aug 31, 2012 7:15 AM by Tamas Foldi

    CASE Syntax error for Oracle custom SQL

    Andy Kriebel

      I am attempting to embed a case statement inside custom sql that connects to Oracle.  This runs perfectly in SQL Developer, but won't run in Tableau.

       

      In Tableau you have to add all of the double quotes, explicit table names, etc.  But I'm getting the error:

       

      Oracle database error 1740: ORA-01740: missing double quote in identifier.

       

      SELECT

        CASE WHEN SUBSTR("TABLE_A"."AGE",0,4)="1-12" THEN "Unknown"

        WHEN SUBSTR("TABLE_A"."AGE",0,4)="0-12" THEN "Unknown"

        WHEN SUBSTR("TABLE_A"."AGE",0,4)="\" THEN "Unknown"

        WHEN "TABLE_A"."AGE" is null THEN "Unknown"

        ELSE "TABLE_A"."AGE" END AS “AGE”

      FROM "DATABASE"."TABLE_A"

       

      I'm fairly certain this is a syntax issue with the custom sql that Tableau expects, but I can't see where I've done anything incorrect. I'm hoping another set of eyes can spot the problem.

       

      Thanks!