SQL scenario step, "create table if not exists"

BlueRabit
BlueRabit Dataiku DSS Core Designer, Dataiku DSS Adv Designer, Registered Posts: 11 ✭✭✭

This is the only step I have in a scenario, it is an execute sql step which consist in :

CREATE TABLE IF NOT EXISTS (table name) (
SELECT * FROM (a dataset of my flow)
)

And the error I get while running the scenario :

[Teradata Database] [TeraJDBC 17.00.00.03] [Error 3706] [SQLState 42000] Syntax error: expected something between the 'TABLE' keyword and the 'IF' keyword.

Pls help me

Answers

  • louisplt
    louisplt Dataiker Posts: 21 Dataiker
    edited July 17

    Hello @BlueRabit
    ,

    Apparently you have a syntax issue. Could you try using the "CREATE AS" syntax like so:

    CREATE TABLE IF NOT EXISTS table_name AS your_query

    Hope this helps

  • BlueRabit
    BlueRabit Dataiku DSS Core Designer, Dataiku DSS Adv Designer, Registered Posts: 11 ✭✭✭

    Hi !

    Tanks for helping, this solution doesn't seems to work neither, it's the same error :

    [Error 3706] [SQLState 42000] Syntax error: expected something between the 'TABLE' keyword and the 'IF' keyword.

    @louisplt

Setup Info
    Tags
      Help me…