Hi guys
I newly started learning oracle.I'm working on my assignment and I'm stuck in this step because of a silly error and I'm sure of my syntax. It looks fine to me but I get this error: ORA-00907: missing right parenthesis


This is the command:
CREATE TABLE WORKER (
Wkr_id int (4),
Name varchar(50),
Hire_date date,
Wage_rate char(10),
Area_ID char(3) references AREA);

It locates the error in line 2 >>
SQL> CREATE TABLE WORKER (
2 Wkr_id int (4),
3 Name varchar(50),
4 Hire_date date,
5 Wage_rate char(10),
6 Area_ID char(3) references AREA)
Wkr_id int (4),
*
ERROR at line 2:
ORA-00907: missing right parenthesis

How can I avoid this???

I think you are entering it as multiple lines. Try it this way.

CREATE TABLE WORKER (Wkr_id int (4),Name varchar(50),Hire_date date,Wage_rate char(10),Area_ID char(3) references AREA)

hi...
i just tried creating the table with the code... just copy pasted this--

CREATE TABLE WORKER (
Wkr_id int (4),
Name varchar(50),
Hire_date date,
Wage_rate char(10),
Area_ID char(3) references AREA);

and it worked fine.. i don't understand why you are getting the error message.

this is what i got...

mysql> CREATE TABLE WORKER (
    -> Wkr_id int (4),
    -> Name varchar(50),
    -> Hire_date date,
    -> Wage_rate char(10),
    -> Area_ID char(3) references AREA);
Query OK, 0 rows affected (0.10 sec)

Referring to which column of AREA table.

Hi fadia,
In my knowledge you can solve this problem by just one modification..
do one thing just change datatype of your expected first column
from int to number

number is the datatype for integers in oracle as you want to create table in oracle.. right??

definately after this it will run successfully ..

CREATE TABLE WORKER (
Wkr_id number(4),
Name varchar(50),
Hire_date date,
Wage_rate char(10),
Area_ID char(3) references AREA);
commented: Wrong answer. -2

Data type Int works in oracle without any error.

@pratik_garg
You need to test the code at least once before posting here.

debasisdas

I have tested it and after that only I was telling about..
and that's why only thhis thread has started...


have you tested what I suggested in my previous post??/
I think you have not that's why.. you are telling this..

okay just do one thing if you can run oracle query .. run query given in question (in oracle database you will definatly find an error)
and if you can run what asking in question then write here your Operating system and your database name...
and tell to fadia that this query is working in your machine...
else try query suggested by me...

before write something for someone you have to test in your machine also...
and yes what idea I got regarding this I have posted here without asking useless question.

so please don't try to put your name for giving such kind of commend only...
if you have answer then best thing is post here .. right??

commented: proving again that you have poor knowledge of Oracle, the query you have posted will always throw error only. -3
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.