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

LVL 1
F-J-KAsked:
Who is Participating?
 
sventhanConnect With a Mentor Commented:
Okay --

    isStayingIn     BOOLEAN
            DEFAULT FALSE CONSTRAINT client_isstayingin_nn NOT NULL

BOOLEAN is not allowed when you creating the table. Its only for PL/SQL.


0
 
sventhanCommented:
Is CONSTRAINT one of your column name? Its a oracle reserved word. Can you change to something else and try?
0
 
sventhanCommented:
The create table syntax is wrong. The statement is messed up with command and constraint key word.
 
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
sventhanCommented:
0
 
sventhanCommented:
ooops sorry. I take all my comments back. There is something else going on.
0
 
Franck PachotConnect With a Mentor Commented:
Hi,
When you run that statement from sqlplus you will see that error occurs at FALSE. Oracle thinks that it is a column name because it is not a sql word and raises an error. If you change that then you will have an error on BOOLEAN as it is not a datatype.
Booleans are often implemented as CHAR(1) that has 'Y'/'N' values, or as a number with 0/1
Regards,
Franck.
0
 
F-J-KAuthor Commented:
Thanks for your response. What is the alternative? I couldn't find any
0
 
F-J-KAuthor Commented:
frankpachot:

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

0
 
F-J-KAuthor Commented:
Yes or No ... Y or N ....

0
 
F-J-KAuthor Commented:
Both responses have helped me
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.