SQL scenario step, "create table if not exists"

BlueRabit
Level 2
SQL scenario step, "create table if not exists"

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 😉

0 Kudos
2 Replies
louisplt
Dataiker

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

 
0 Kudos
BlueRabit
Level 2
Author

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 

0 Kudos