0

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
Community
  • 1
  • 1
Ray Bae
  • 89
  • 1
  • 4
  • 10
  • I was facing same issue, refer my answer in [stackoverflow link](https://stackoverflow.com/questions/28806412/sql-error-ora-02000-missing-always-keyword-when-create-identity-column-based-t/66715954#66715954) – Pavn Mar 19 '21 at 21:52

1 Answers1

0

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

thatjeffsmith
  • 20,522
  • 6
  • 37
  • 120
  • Thanks. We've done some testing and haven't been able to deduce why these tables failed on the initial run. They're all working now. No changes to the environment. – Ray Bae Dec 18 '15 at 19:23