Link to home
Start Free TrialLog in
Avatar of F-J-K
F-J-KFlag for Canada

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...
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
);

Open in new window

Avatar of sventhan
sventhan
Flag of United States of America image

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.
 
ooops sorry. I take all my comments back. There is something else going on.
ASKER CERTIFIED SOLUTION
Avatar of sventhan
sventhan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Franck Pachot
Franck Pachot
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of F-J-K

ASKER

Thanks for your response. What is the alternative? I couldn't find any
Avatar of F-J-K

ASKER

frankpachot:

Thanks. I got it
What are the values you planning to store into that BOOLEAN column?

Avatar of F-J-K

ASKER

Yes or No ... Y or N ....

Avatar of F-J-K

ASKER

Both responses have helped me