Hi, Is It possible to add new column in table after checking whether column already exists or not?Ap
Hi, Is It possible to add new column in table after checking whether column already exists or not?Appreciate your help. Thank you.
0
Comments
If I understood it correctly, you want that vertica first check if the newly added column is already there in table or not?
So if I have a table TAB with below definition
Schema | Table | Column | Type | Size | Default | Not Null | Primary Key | Foreign Key
--------+-------+---------+-------------+------+---------+----------+-------------+-------------
public | TAB | name | varchar(10) | 10 | | f | f |
public | TAB | desg | varchar(10) | 10 | | f | f |
Then if I try to add a new column "name", then it will throw a warning
gl=> alter table TAB add column name varchar(10);
ROLLBACK 3145: Duplicate column name
Please let me know if this is what you were asked
Thanks
Hope this answers your query if not let us know what you are looking for, we would be glad to help you.