Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Table with Multiple Foreign Keys

Table with Multiple Foreign Keys

Scheduled Pinned Locked Moved Database
helpdatabaseoracletoolsjson
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    ASPnoob
    wrote on last edited by
    #1

    Hi All, I'm trying to create a table that has one primary key with multiple foreign keys which reference different tables. The following is how I declared my table: CREATE TABLE COURSE_SECTION ( Csecid NUMBER(8), Secnum NUMBER(2) NOT NULL, Maxenrl NUMBER(4) NOT NULL, Currenrl NUMBER(4) NOT NULL, Cid NUMBER(6) NOT NULL, Termid NUMBER(5) NOT NULL, Day VARCHAR2(10), Locid NUMBER(5), Fid NUMBER(4), primary Key (Csecid), foreign Key (Cid) references COURSE(Cid), foreign Key (Termid) references TERM(Termid), foreign Key (Locid) references LOCATION(Locid), foreign Key (Fid) references FACULTY(Fid) ); I've receive the error message "unknown command beginning ........ - rest of line ignored" for many of the lines when I execute the above script in Oracle SQL Plus. I have tried many different things like rewording the lines or capitalize the letters of the attributes but my attempts were futile. Can you please point out what I have done wrong? Thank you in advance for your help.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups