Oracle Forums
It is currently Mon Sep 06, 2010 3:44 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: need help .... any one
PostPosted: Tue Mar 09, 2010 7:33 pm 
Offline

Joined: Tue Mar 09, 2010 7:22 pm
Posts: 1
SQL> CREATE TABLE STAFF
2 (staff_NO VARCHAR2(20),
3 first_name VARCHAR2(20),
4 last_name VARCHAR2(25),
5 salary NUMBER (8) CONSTRAINT check_salary CHECK (salary => 2000 AND salary <= 6000),
6 *** varchar2(1) CONSTRAINT gender_check CHECK (*** in ('m','f'),
7 department_name NUMBER(4),
8 superstaff_no NUMBER(4),
9 Job_no NUMBER(4),
10 Constraint staff_NO_pk PRIMARY KEY (STAFF_NO)
11 cONSTRAINT DEPT_Name_FK FOREIGN KEY (department_name)
12 refrences DEPARTMENT(DEPT_NAME)
13 cONSTRAINT SSN_FK FOREIGN KEY (SUPERSTAFF_NO)
14 refrences STAFF(superstaff_no)
15 cONSTRAINT Job_NO_FK FOREIGN KEY (Job_NO)
16 refrences staff(Job_no) );
salary NUMBER (8) CONSTRAINT check_salary CHECK (salary => 2000 AND salary <= 6000),
*
ERROR at line 5:
ORA-00936: missing expression
:cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry: :cry:


Top
 Profile  
 
 Post subject: Re: need help .... any one
PostPosted: Wed Mar 10, 2010 1:18 pm 
Offline
Site Admin

Joined: Tue Feb 10, 2009 5:18 pm
Posts: 77
welcome to the forum codee240

_________________
Craig

Oracle APEX - http://www.oracleapplicationexpress.com


Top
 Profile  
 
 Post subject: Re: need help .... any one
PostPosted: Wed Mar 10, 2010 2:14 pm 
Offline
Site Admin

Joined: Tue Feb 10, 2009 5:18 pm
Posts: 77
try this

Code:
CREATE TABLE STAFF
(staff_NO VARCHAR2(20),
first_name VARCHAR2(20),
last_name VARCHAR2(25),
salary NUMBER (8) CONSTRAINT check_salary CHECK (salary >= 2000 AND salary <= 6000),
a varchar2(1) CONSTRAINT gender_check CHECK (a in ('m','f')),
department_name NUMBER(4),
superstaff_no NUMBER(4),
Job_no NUMBER(4),
Constraint staff_NO_pk PRIMARY KEY (STAFF_NO),
cONSTRAINT DEPT_Name_FK FOREIGN KEY (department_name) references DEPARTMENT(DEPT_NAME),
cONSTRAINT SSN_FK FOREIGN KEY (SUPERSTAFF_NO) references STAFF(superstaff_no),
cONSTRAINT Job_NO_FK FOREIGN KEY (Job_NO) references staff(Job_no) );

_________________
Craig

Oracle APEX - http://www.oracleapplicationexpress.com


Top
 Profile  
 
 Post subject: Re: need help .... any one
PostPosted: Wed Mar 10, 2010 3:20 pm 
Offline

Joined: Fri Feb 13, 2009 11:37 am
Posts: 118
Hi Codee,
What did you wanted to do with the 3 asteriks?

_________________
Regards
Ozy
http://www.oraclevillage.com/


Top
 Profile  
 
 Post subject: Re: need help .... any one
PostPosted: Wed Mar 10, 2010 6:22 pm 
Offline
Site Admin

Joined: Tue Feb 10, 2009 5:18 pm
Posts: 77
usman wrote:
Hi Codee,
What did you wanted to do with the 3 asteriks?


good point. i changed them to "a" to get the code to work. forgot to mention that :oops:

_________________
Craig

Oracle APEX - http://www.oracleapplicationexpress.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Template made by DEVPPL