Job Seekers   Employers
dbapool: Authors | Submissions | Contact Us
   Forgot password? | Sign up
  Home   Discussion Forum   Articles   Interview Questions   FAQs   Scripts   Rewards   Analyzer   White Papers   Blog   Certification   Downloads   Tools
 

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

  




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 Khokhar857
  Mohammed Taj746
  positive fanatic483
  Jayanta Sur479
  Vigyan Kaushik387
  Vinoth Kumar379
  Gopu Gopi350
  Gitesh Trivedi322
  neeraj sharma258
  Ramesh Jois246






oracle Mag



  About Us Advertise Terms of Use Privacy Newsletters Contact Us    

Home   Discussion Forum   FAQs  Articles  Jobs   Newsletters  Directory  Downloads 

Our Premium Sponsor
Confio Software