its-akhr
its-akhr

Reputation: 142

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.

Upvotes: 1

Views: 621

Answers (1)

LukStorms
LukStorms

Reputation: 29647

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.

Upvotes: 1

Related Questions