I am trying to run the following query
Select 'drop table'||distinct(TableName)||';'
From dbc.indices
Where DatabaseName = 'STG_x'
The query spits out a syntax error: expected something between "'||'" and the 'distinct' keyword.
Basically I want to list all the distinct TableNames with
'drop table' before the table name and ';' after the table name.
so I want
NAME
--------------
drop table a;
drop table b;
drop table c;
..
..
..
can anybody suggest where I am going wrong in the query?
I am using teradata rdbms.
Thanks
bcd
Select 'drop table'||distinct(TableName)||';'
From dbc.indices
Where DatabaseName = 'STG_x'
The query spits out a syntax error: expected something between "'||'" and the 'distinct' keyword.
Basically I want to list all the distinct TableNames with
'drop table' before the table name and ';' after the table name.
so I want
NAME
--------------
drop table a;
drop table b;
drop table c;
..
..
..
can anybody suggest where I am going wrong in the query?
I am using teradata rdbms.
Thanks
bcd