Home » SQL & PL/SQL » SQL & PL/SQL » ORA-00922: missing or invalid option (merged 3)
ORA-00922: missing or invalid option (merged 3) [message #362943] Thu, 04 December 2008 11:35 Go to next message
anoopam9
Messages: 6
Registered: December 2008
Junior Member
CREATE TABLE Users ( USER_ID INT NOT NULL AUTO_INCREMENT,IP_ADDRESS VARCHAR2(30) NOT NULL,PRIMARY KEY(IP_ADDRESS));


ERROR at line 1:
ORA-00922: missing or invalid option


can someone help me telling what's wrong in the query.
Re: ORA-00922: missing or invalid option (merged 3) [message #362949 is a reply to message #362943] Thu, 04 December 2008 11:43 Go to previous messageGo to next message
Michel Cadot
Messages: 64153
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Don't multipost your question but read read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter) and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version (4 decimals).

Use SQL*Plus and copy and paste your session like that:
SQL> CREATE TABLE Users ( USER_ID INT NOT NULL AUTO_INCREMENT,IP_ADDRESS VARCHAR2(30) NOT NULL,PRIMARY KEY(IP_ADDRESS));
CREATE TABLE Users ( USER_ID INT NOT NULL AUTO_INCREMENT,IP_ADDRESS VARCHAR2(30) NOT NULL,PRIMARY KEY(IP_ADDRESS))
                                          *
ERROR at line 1:
ORA-00907: missing right parenthesis

AUTO_INCREMENT does not exist in Oracle.

Regards
Michel
Re: ORA-00922: missing or invalid option (merged 3) [message #362952 is a reply to message #362949] Thu, 04 December 2008 11:51 Go to previous messageGo to next message
anoopam9
Messages: 6
Registered: December 2008
Junior Member
so how do I create an auto_increment column in a table ?

I found this
http://www.lifeaftercoffee.com/2006/02/17/how-to-create-auto-increment-columns-in-oracle/

do i need to follow this ?
Re: ORA-00922: missing or invalid option (merged 3) [message #362953 is a reply to message #362952] Thu, 04 December 2008 11:54 Go to previous message
joicejohn
Messages: 327
Registered: March 2008
Location: India
Senior Member
@anoopam9,

Yes, Creating and using a Sequence is the option in Oracle against AUTO_INCREMENT option available in SQL Server.

Regards,
Jo

[Updated on: Thu, 04 December 2008 11:59]

Report message to a moderator

Previous Topic: How to send mail through pl/sql
Next Topic: SQL-PLUS FOREIGN KEY HELP!!
Goto Forum:
  


Current Time: Sun Dec 11 06:19:11 CST 2016

Total time taken to generate the page: 0.10909 seconds