oracle11gora-00904

SQL Error: ORA-00904: : invalid identifier in line 4


I was working in sql command line and got this error ORA-00904 when i queried to create a table

Query Screenshot

I tried various inputs and got the same error in line 4. Help me out.


Solution

  • If you create a table

    Then this would work :

    CREATE TABLE DATA
    (
      ID INT NOT NULL,
      NAME VARCHAR2(10) NOT NULL
    );
    

    But this would raise an ORA-00904 :

    CREATE TABLE DATA
    (
      ID INT NOT NULL,
      NAME VARCHAR2(10) NOT NULL,
    );
    

    The difference?
    After that last comma, something more is expected.
    Yet, all it finds is a round bracket.
    Hence, the error.