Home » SQL & PL/SQL » SQL & PL/SQL » Need Help plz
Need Help plz [message #209479] Fri, 15 December 2006 02:12 Go to next message
Kingdog
Messages: 5
Registered: December 2006
Junior Member
I'm new here and also new with SQL, and I know this problem I have may be pretty simple to most of you, but I'm having this problem when I run the script, plz help.


(Func_ID Number(4) Primary Key Not Null,
*
ERROR at line 2:
ORA-00922: missing or invalid option


This is the part of my script which is having this error


Create Table Function
(Func_ID Number(4) Primary Key Not Null,
Dec_Theme Varchar2(20) Not Null,
Book_Date Date Not Null,
Chef_ID Number(5),
Client_ID Number(4) Not Null,
Room_ID Number(3),
Constraint FK_CHEF_ID Foreign Key (Chef_ID) References Chef
FK_CLIENT_ID Foreign Key (Client_ID) References Client 
FK_ROOM_ID Foreign Key (Room_ID) References Room);

Re: Need Help plz [message #209483 is a reply to message #209479] Fri, 15 December 2006 02:43 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
you missed a few comma's and keywords when you tried to add the constraints. I suggest you change to table name to something that is not an Oracle reserved word.

Create Table function
(Func_ID Number(4) Primary key Not Null,
Dec_Theme Varchar2(20) Not Null,
Book_Date Date Not Null,
Chef_ID Number(5),
Client_ID Number(4) Not Null,
Room_ID Number(3),
Constraint FK_CHEF_ID Foreign Key (Chef_ID) References Chef,
Constraint FK_CLIENT_ID Foreign Key (Client_ID) References Client, 
Constraint FK_ROOM_ID Foreign Key (Room_ID) References Room);


MHE
Re: Need Help plz [message #209484 is a reply to message #209479] Fri, 15 December 2006 02:43 Go to previous messageGo to next message
vamsi kasina
Messages: 2107
Registered: October 2003
Location: Riyadh, Saudi Arabia
Senior Member
Primary key itself a not null column.
remove Not null.
Also use some other name to the table, as function is a keyword.

By
Vamsi
Re: Need Help plz [message #209487 is a reply to message #209484] Fri, 15 December 2006 02:52 Go to previous message
Kingdog
Messages: 5
Registered: December 2006
Junior Member
Thanks for the help ^^
Previous Topic: how to calculate total duration of the course hours
Next Topic: LEFT JOIN
Goto Forum:
  


Current Time: Fri Dec 09 21:26:50 CST 2016

Total time taken to generate the page: 0.16535 seconds