1 Reply Latest reply on May 2, 2018 9:15 AM by John Cantu

    "IF EXISTS" equivalent in Tableau (Teradata code)

    Althea Anderson

      The sql below I can use in Teradata just fine, but not in my Custom SQL.  What I would like to do is have the database searched for a table and if it's there (EXISTS) to drop it so a new table gets created (Initial sql).  If It is not there, then it will get created.  Any ideas?

      SELECT 1 FROM dbc.TablesV WHERE databasename = 'enter name' AND TABLENAME = 'enter name'; 
      IF ACTIVITYCOUNT = 0 THEN GOTO ok DROP TABLE FullTableName; LABEL ok

      Thanks, Althea