F-J-K
asked on
Error ORA-00984: Column Not Allowed Here - Where Did i Go Wrong? - Oracle Relational DB
I can not run the code below, i keep getting this error:
ORA-00984: column not allowed here
I don't see any mistake in there! Can you please help me...
ORA-00984: column not allowed here
I don't see any mistake in there! Can you please help me...
CREATE TABLE Client
(
clientID NUMBER(7) , CONSTRAINT client_clientid_pk PRIMARY KEY(clientID) ,
firstName VARCHAR2(50) CONSTRAINT client_firstname_nn NOT NULL ,
lastName VARCHAR2(50) CONSTRAINT client_lastname_nn NOT NULL ,
email VARCHAR2(50) ,
address1 VARCHAR2(100) CONSTRAINT client_address1_nn NOT NULL ,
address2 VARCHAR2(100) ,
cityID NUMBER(7) CONSTRAINT client_cityid_nn NOT NULL ,
CONSTRAINT client_cityid_fk FOREIGN KEY(cityID) REFERENCES City(cityID) ,
provinceID NUMBER(7) CONSTRAINT client_provinceid_nn NOT NULL ,
CONSTRAINT client_provinceid_fk FOREIGN KEY(provinceID) REFERENCES Province(provinceID) ,
postalCode VARCHAR2(50) CONSTRAINT client_postalcode_nn NOT NULL ,
countryID NUMBER(7) CONSTRAINT client_countryid_nn NOT NULL ,
CONSTRAINT client_countryid_fk FOREIGN KEY(countryID) REFERENCES Country(countryID) ,
gender CHAR(1) CONSTRAINT client_gender_ck CHECK(gender IN ('M', 'F')) ,
clientStatus VARCHAR2(10) CONSTRAINT client_clientstatus_nn NOT NULL ,
numOfFamilyMembers NUMBER(1) DEFAULT 0 CONSTRAINT client_numoffamilymembers_nn NOT NULL ,
isStayingIn BOOLEAN DEFAULT FALSE CONSTRAINT client_isstayingin_nn NOT NULL
);
Is CONSTRAINT one of your column name? Its a oracle reserved word. Can you change to something else and try?
The create table syntax is wrong. The statement is messed up with command and constraint key word.
Check this for the correct syntax...
http://www.techonthenet.com/oracle/foreign_keys/foreign_keys.php
ooops sorry. I take all my comments back. There is something else going on.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for your response. What is the alternative? I couldn't find any
ASKER
frankpachot:
Thanks. I got it
Thanks. I got it
What are the values you planning to store into that BOOLEAN column?
ASKER
Yes or No ... Y or N ....
ASKER
Both responses have helped me