The column to be modified is not an identity column.

I created a table with a column S_ROLL NUMBER(3) NOT NULL Now I want this column to be like an identifier column. I used this command

 alter table students modify ( S_ROLL NUMBER GENERATED BY DEFAULT ON NULL AS IDENTITY ); 

Then I get this error.

 S_ROLL NUMBER GENERATED BY DEFAULT ON NULL AS IDENTITY * ERROR at line 4: ORA-30673: column to be modified is not an identity column 
+7
source share
2 answers

You get this error simply because modifying an existing column as an IDENTITY column is not supported right now.

+15
source

Because modifying an existing column to identify a column is not supported. So you can use the query below to add a new column.

 ALTER TABLE students ADD (S_ROLL_NEW NUMBER(3) GENERATED ALWAYS AS IDENTITY); 
0
source

Source: https://habr.com/ru/post/1241346/


All Articles