-3
CREATE TABLE Persons
(
ID int NOT NULL AUTO_INCREMENT,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Address varchar(255),
City varchar(255),
PRIMARY KEY (ID)
)

Error starting at line 1 in command: CREATE TABLE Persons ( ID int NOT NULL AUTO_INCREMENT, LastName varchar(255) NOT NULL, FirstName varchar(255), Address varchar(255), City varchar(255), PRIMARY KEY (ID) ) Error at Command Line:3 Column:17 Error report: SQL Error: ORA-00907: missing right parenthesis 00907. 00000 - "missing right parenthesis" *Cause: *Action:

Tobi
  • 1,440
  • 1
  • 13
  • 26
Suresh
  • 1
  • 1
  • 1
    Error seems like an Oracle DB? Is it right? – Tobi Jan 29 '15 at 07:03
  • I would like to know if there is any other alternative. I tried with checking out if in the UI i had any feature to add the auto increment condition. But, i was unable to find one – Suresh Jan 29 '15 at 07:04
  • I think you are missing a semicolon – Sam-Graham Jan 29 '15 at 07:04
  • Yes @Tobi but i'm unable to fix it. Any suggestions? – Suresh Jan 29 '15 at 07:05
  • If its Oracle, try this: http://stackoverflow.com/questions/11296361/how-to-create-id-with-auto-increment-on-oracle – Tobi Jan 29 '15 at 07:05
  • Still the same.. and it doesn't matter about semicolon if its a single query right? – Suresh Jan 29 '15 at 07:06
  • In Oracle12 you can use an identity column: https://docs.oracle.com/database/121/SQLRF/statements_7002.htm#SQLRF01402 –  Jan 29 '15 at 07:28

1 Answers1

0

In Oracle, there is no AUTO_INCREMENT. Try the solution in this link to trigger an auto increment:

Community
  • 1
  • 1
Tobi
  • 1,440
  • 1
  • 13
  • 26