Sql developer gives an error of:
ORA-00907: missing right parenthesis, for next table :
x
create table customer (
CUSTOMER_ID number identity (1,1) not null,
CUSTOMER_PHONE char(13) not null
);
Also the ‘identity is red underlined, have no idea why
Advertisement
Answer
Proper syntax for Oracle 12c and newer:
create table customer (
CUSTOMER_ID NUMBER GENERATED ALWAYS AS IDENTITY,
CUSTOMER_PHONE char(13) not null
);
-- explicit start and increment
create table customer (
CUSTOMER_ID NUMBER GENERATED ALWAYS AS IDENTITY(START WITH 1 INCREMENT BY 1),
CUSTOMER_PHONE char(13) not null
);