Results 1 to 2 of 2

Thread: simple problem

  1. #1
    Join Date
    Feb 2004
    Posts
    78

    Unanswered: simple problem

    hey peeps i am new to sql and have created the following table in my database but get the following error(below), where am i going wrong?



    )
    *

    ERROR at line 11:
    ORA-00905: missing keyword


    CREATE TABLE Staff_table
    (
    StaffNo INT NOT NULL,
    Name VARCHAR(40) NOT NULL,
    Address VARCHAR(255) NOT NULL,
    Salary INT NOT NULL,
    DOB TIMESTAMP(6) NOT NULL,
    OfficeNo INT NOT NULL,
    PRIMARY KEY(StaffNo),
    FOREIGN KEY(OfficeNo)
    );

  2. #2
    Join Date
    Jan 2003
    Location
    Paris, France
    Posts
    320
    For Foreign key it should be

    FOREIGN KEY contraint_name (OfficeNo) REFERENCE table_name (Col name)
    Olivier Miossec
    --
    http://www.lasso-developpeur.net/
    --

Posting Permissions

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