Page 1 of 1

Alter Table is column exists

Posted: Thu Jul 09, 2015 3:49 pm
by Richie1
Hello

I have searched far and wide and I cannot find any code that will allow me to alter a table (drop the column) if the column exists in my HP Vertica database.
Can anyone help me please?
An example of this in postgreSql would look like the following.

Code: Select all

ALTER TABLE PORTALIQ.dimSourceTypeS DROP COLUMN IF EXISTS SourceKey;
Thank you

Re: Alter Table is column exists

Posted: Mon May 23, 2016 3:03 am
by NorbertKrupa
That syntax is not supported in Vertica's ALTER TABLE. You may want to check a system table of columns whether the column exists before running an ALTER TABLE.