Topic: SQL*Plus and PL/SQL >> ORA-00922: missing or invalid option problem??
|
Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property.
You may review the entire Oracle Certification Program Candidate Agreement online Here.
|
|
|
|
| Title: ORA-00922: missing or invalid option problem?? |
| vuong |
Posted: Feb 09, 2007 05:15:06 PM |
Total Post: 7
Joined: Jan, 2007
|
Hi i am creating this table:
CREATE TABLE BookTitle(
itemRef VARCHAR2(10) CONSTRAINT itemRef NOT NULL,
ISBN VARCHAR2(13) CONSTRAINT ISBN NOT NULL,
title VARCHAR2(30) CONSTRAINT title NOT NULL,
author VARCHAR2(30) CONSTRAINT author NOT NULL,
edition VARCHAR2(4),
publisher VARCHAR2(20),
year NUMBER(4),
location VARCHAR2(4)
city VARCHAR2(20),
postcode VARCHAR2(8),
CONSTRAINT BookTitle_PK KEY(itemRef)
);
but when i run the file i get the following error message:
------------------------------------------------------------------
CREATE TABLE BookTitle(
*
ERROR at line 1:
ORA-00922: missing or invalid option
-------------------------------------------------------------------
Can som1 tell me what i must do to resolve this .
|
|
|
SatyaN |
| Posted: Feb 09, 2007 06:36:00 PM | |
|
Total Post: 28
Joined: Nov, 2006
|
try changing 'key' to 'primary key.'
|
|
|
|
|
Manish |
| Posted: Feb 12, 2007 07:05:39 AM | |
|
Total Post: 5
Joined: Jan, 2007
|
You also missed comma after location column. The final query goes like this:
CREATE TABLE BookTitle(
itemRef VARCHAR2(10) CONSTRAINT itemRef NOT NULL,
ISBN VARCHAR2(13) CONSTRAINT ISBN NOT NULL,
title VARCHAR2(30) CONSTRAINT title NOT NULL,
author VARCHAR2(30) CONSTRAINT author NOT NULL,
edition VARCHAR2(4),
publisher VARCHAR2(20),
year NUMBER(4),
location VARCHAR2(4),
city VARCHAR2(20),
postcode VARCHAR2(8),
CONSTRAINT BookTitle_PK PRIMARY KEY(itemRef)
);
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |
|
|
|
|
Forum Rules & Description
Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user
|
| |
Get FREE Magazines
|
Top 10 Forum User
|
| Murtuja Khokhar | 857 |
| Mohammed Taj | 746 |
| positive fanatic | 483 |
| Jayanta Sur | 479 |
| Vigyan Kaushik | 387 |
| Vinoth Kumar | 379 |
| Gopu Gopi | 350 |
| Gitesh Trivedi | 322 |
| neeraj sharma | 258 |
| Ramesh Jois | 246 |
|
|