a problem with create table statement
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: a problem with create table statement

  1. #1
    Join Date
    Oct 2001
    Posts
    16
    create table emp
    (
    empno number(4) not null,
    ename char(10),
    job char(9),
    mgr number(4),
    hiredate date,
    sal number(7,2),
    comm number(7,2),
    deptno number(2) not null,
    foreign key(deptno) references dept(deptno)
    constraint emp_f,
    foreign key(empno) references emp
    (empno) constraint emp_self,
    primary key(empno) constraint emp_pri
    );

    @emp

    I get an error with the following message:
    constraint emp_f
    *
    ERROR at line 12:
    ORA-00907: missing right paranthesis

    I will be very grateful if anybody could tell me the problem.

    Thank u.

    Gautam Bhagwandas

    Web Site : www.geocites.com/gautamzone

  2. #2
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Wrong syntax. Change that to:

    create table emp
    (
    empno number(4) not null,
    ename char(10),
    job char(9),
    mgr number(4),
    hiredate date,
    sal number(7,2),
    comm number(7,2),
    deptno number(2) not null,
    constraint emp_f foreign key(deptno) references dept(deptno),
    constraint emp_self foreign key(empno) references emp(empno),
    constraint emp_pri primary key(empno)

    );
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width