This afternoon I conducted an experiment to add, modify, and delete columns in the test table. The procedure is as follows:
Add a column:
Alter table emp4 add test varchar2 (10 );
Modify a column:
Alter table emp4 modify test varchar2 (20 );
Delete a column:
Alter table emp4 drop column test;
Here pay attention to a few places, first, add and modify the COLUMN is not need to add the keyword COLUMN, otherwise it will report an error ora-00905.
Second, if you delete a single COLUMN, you must add COLUMN. Remember that you do not need to add the COLUMN type to delete the COLUMN.
The procedure is as follows;
Add multiple columns:
Alter table emp4 add (test varchar2 (10), test2 number );
Modify multiple columns:
Alter table emp4 modify (test varchar2 (20), test2 varchar2 (20 ));
Delete multiple columns:
Alter table emp4 drop (test, test2 );
It is strange that the keyword COLUMN must be added to a single COLUMN. However, when you delete multiple columns, the COLUMN keyword cannot be added.