0
votes

I'm able to create the following table in my environment. However, in our QA environment, it fails with the following error:

Error report:
SQL Error: ORA-02000: missing ( keyword
02000. 00000 -  "missing %s keyword"

Originally, we got the error described in this thread until I changed:

GENERATED BY DEFAULT AS IDENTITY

To:

GENERATED ALWAYS AS IDENTITY

Here's the code, and specifications:

Table:

CREATE TABLE table1(
ID NUMBER(10) GENERATED ALWAYS AS IDENTITY
);

My Environment: (Working)

  • Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit
  • PL/SQL Release 12.1.0.1.0
  • CORE 12.1.0.1.0
  • TNS for 64-bit Windows: Version 12.1.0.1.0
  • NLSRTL Version 12.1.0.1.0

QA Environment: (Failing)

Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit

  • PL/SQL Release 12.1.0.2.0
  • CORE 12.1.0.2.0
  • TNS for 64-bit Windows: Version 12.1.0.2.0
  • NLSRTL Version 12.1.0.2.0
1
I was facing same issue, refer my answer in stackoverflow linkPavn

1 Answers

0
votes

No, they haven't been removed.

CREATE TABLE TABLE1 
(
  ID_COL_PK NUMBER GENERATED BY DEFAULT AS IDENTITY INCREMENT BY 1      START WITH 1 MINVALUE 1 CACHE 2000 ORDER NOT NULL 
, CONSTRAINT TABLE1_PK PRIMARY KEY 
  (
    ID_COL_PK 
  )
  ENABLE 
);

Docs