-1

I'm relatively new to Oracle but I'm getting an error, ORA-00922, when I'm trying to execute the following statement:

CREATE TABLE RT_action_items (
  action_itemID INT NOT NULL AUTO_INCREMENT, 
  reviewID varchar2(20) NOT NULL, 
  reviewer_username varchar2(50) NOT NULL, 
  dispositionID INT NOT NULL, 
  errorID INT NOT NULL, 
  action CLOB DEFAULT NULL,
  presenter_implemented INT DEFAULT NULL,
  date_implemented date DEFAULT NULL,
  actioned_by varchar2(20) DEFAULT NULL, 
  presenter_response CLOB DEFAULT NULL,
  PRIMARY KEY (action_itemID)
)

All help is greatly appreciated. I've checked to make sure CLOB doesn't need a default value, neither does INT obviously... Yeah I'm stumped.

Thanks in advance!

Corey Thompson
  • 398
  • 6
  • 18
  • 3
    There is no auto_increment in Oracle, see http://stackoverflow.com/questions/11296361/how-to-create-id-with-auto-increment-on-oracle for the solution. – Brian DeMilia Aug 26 '14 at 01:53
  • Derp, thanks so much. I googled auto increment for Oracle and the first result was a working auto_increment, and on docs.oracle.com, so I assumed (incorrectly) that it worked. Turned out to be MySQL on the Oracle website. Anyway, thanks agani! – Corey Thompson Aug 26 '14 at 01:58
  • Gotta love how they stick their logo on everything :) no problem – Brian DeMilia Aug 26 '14 at 01:59
  • I guess that you saw a page about MySQL. Oracle bought MySQL... – Luc M Aug 26 '14 at 02:11

1 Answers1

1

Thanks to @Brian DeMilia in the comments on the first post.

There's no Auto increment for Oracle. Sample solutions to achieve the same thing are:

How to create id with AUTO_INCREMENT on Oracle?

http://jen.fluxcapacitor.net/geek/autoincr.html

Community
  • 1
  • 1
Corey Thompson
  • 398
  • 6
  • 18