Tuesday, March 18, 2014

ORA-12983

If you try to drop all columns in a table, you get an ORA-12983 as you cannot have a table with no columns. You can see what I mean in the examples below, which I ran in an Oracle 11.2 database:

SQL> create table tab1
  2  (col1 number)
  3  /
 
Table created.
 
SQL> alter table tab1 drop column col1
  2  /
alter table tab1 drop column col1
*
ERROR at line 1:
ORA-12983: cannot drop all columns in a table
 
SQL> create table tab2
  2  (col1 number,
  3   col2 number)
  4  /
 
Table created.
 
SQL> alter table tab2 drop (col1, col2)
  2  /
alter table tab2 drop (col1, col2)
*
ERROR at line 1:
ORA-12983: cannot drop all columns in a table
 
SQL>

No comments:

Post a Comment