Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2013
    Posts
    19

    Unanswered: Error While Creating Identity Column

    Hi,
    Can someone help me with where I'm going wrong here?

    Code:
    CREATE TABLE INSIGHT_AUDIT_DTL
    (
    AUDIT_DTL_ID number generated always as identity,
    AUDIT_ID INTEGER,
    COLUMN_NM VARCHAR2(32 BYTE),
    OLD_VAL VARCHAR2(100 BYTE),
    NEW_VAL VARCHAR2(100 BYTE),
    CHNG_TYP VARCHAR2(30 BYTE)
    );
    It throws the error

    Code:
    Error starting at line 1 in command:
    CREATE TABLE INSIGHT_AUDIT_DTL
    (
    AUDIT_DTL_ID number generated always as identity,
    AUDIT_ID INTEGER,
    COLUMN_NM VARCHAR2(32 BYTE),
    OLD_VAL VARCHAR2(100 BYTE),
    NEW_VAL VARCHAR2(100 BYTE),
    CHNG_TYP VARCHAR2(30 BYTE)
    )
    Error at Command Line:3 Column:41
    Error report:
    SQL Error: ORA-02000: missing ( keyword
    02000. 00000 -  "missing %s keyword"

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    post complete results from SQL below

    SELECT * FROM V$VERSION;
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Apr 2013
    Posts
    19
    Code:
    Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production
    PL/SQL Release 11.2.0.2.0 - Production
    "CORE	11.2.0.2.0	Production"
    TNS for 32-bit Windows: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production

  4. #4
    Join Date
    Nov 2003
    Posts
    2,933
    Provided Answers: 12
    Oracle 11.2 does not have "identity" columns. Please read the manual
    I will not read nor answer questions where the SQL code is messy and not formatted properly using [code] tags: http://www.dbforums.com/misc.php?do=bbcode#code

    Tips for good questions:

    http://tkyte.blogspot.de/2005/06/how...questions.html
    http://wiki.postgresql.org/wiki/SlowQueryQuestions
    http://catb.org/esr/faqs/smart-questions.html

  5. #5
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Oracle V12 supports IDENTITY columns

    CREATE TABLE
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  6. #6
    Join Date
    Dec 2007
    Location
    Richmond, VA
    Posts
    1,328
    Provided Answers: 5
    also, just a tip on identity columns, stay away from generated always, use by default. Not an issue in prod database, becomes an issue in test machines when you try to copy a subset of data over and there are dependancies on keeping the ID the same due to child table data.
    Dave

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •