I create table in oracle and I want add auto increment for my primary key
CREATE TABLE "TEST_1"."PERSON"
("ID" NUMBER NOT NULL ENABLE,
"FNAME" VARCHAR2(20 BYTE),
"LNAME" VARCHAR2(20 BYTE),
CONSTRAINT "PERSON_PK" PRIMARY KEY ("ID"));
Using Oracle sql develope when I want alter ID to get Auto Increment for primary key I get error ORA-02262: ORA-932
I have two raw in table
ALTER TABLE PERSON
MODIFY (ID DEFAULT SYS_GUID() );
The oracle show this error means: // *Cause: New column datatype causes type-checking error for existing column // default value expression. // *Action: Remove the default value expression or don't alter the column // datatype.
are you not using Sequences for it ??