Handling error in alter table or create index statement if the column / index already exists
Hi
We have a process in place where we run a script on our database that includes adding new column to an existing table or creating a new index on existing table. The script output is written to a log file
for example
Alter table test add (zipcode varchar2(5));
OR
Create index idx_test_zip on test (zipcode)
The problem is that if the column or the index exist, we get an error
ERROR at line 1:
ORA-01430: column being added already exists in table
ERROR at line 1:
ORA-00955: name is already used by an existing object
What we need is that if the column or index to be added already exists, the script
0