Skip to content
Home » Oracle » Oracle ALTER TABLE DROP Column By Examples

Oracle ALTER TABLE DROP Column By Examples

The syntax of dropping a column is pretty easy.

SQL> show user
USER is "HR"
SQL> alter table employees drop column salary;

Table altered.

As long as there's no referential constraint on it.

SQL> alter table employees drop column employee_id;
alter table employees drop column employee_id
                                  *
ERROR at line 1:
ORA-12992: cannot drop parent key column

Now you have to deal with ORA-12992 first.

Leave a Reply

Your email address will not be published. Required fields are marked *