Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9000011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:15:22+00:00 2026-06-16T00:15:22+00:00

Hey all I’m trying to create a table that contains a Foreign Key ,

  • 0

Hey all I’m trying to create a table that contains a Foreign Key, and for some reason I am getting an error. The error says 00907. 00000 - "missing right parenthesis" which is odd because I don’t have a random left parenthesis. I looked up how to create a table with a Foreign Key and that led to the following code:

Create Table EMPHIREINFO
(
empname VARCHAR2(10) NOT NULL FOREIGN KEY REFERENCES EMPADDRESS(empname),
empno NUMBER(4,0) NOT NULL PRIMARY KEY,
startdt DATE,
enddt DATE,
cntrlgth NUMBER(5,0)
)

I tried it with and without the REFERENCES EMPADDRESS(empname) and I still get the same error. Any help is appreciated, thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:15:23+00:00Added an answer on June 16, 2026 at 12:15 am

    You need to specify column after FOREIGN KEY. However, I’d prefer to use naming constraints, for instance

    Create Table EMPHIREINFO
    (
    empname VARCHAR2(10) NOT NULL ,
    empno NUMBER(4,0) NOT NULL ,
    startdt DATE,
    enddt DATE,
    cntrlgth NUMBER(5,0),
    CONSTRAINT PK_EMPHIREINFO PRIMARY KEY(empno) USING INDEX
     (CREATE UNIQUE INDEX IDXU_EMPHIREINFO_empno ON EMPHIREINFO(empno) ),
     CONSTRAINT FK_EMPHIREINFO_EMPNAME FOREIGN KEY(empname)
     REFERENCES EMPADDRESS(empname)
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey all i am trying to find some code that would allow me to
Hey all i am in need of some help getting my code working correctly
Hey all i have a JSFiddle that i have been working on with trying
Hey all i have an XML file that i am trying to loop though.
Hey all i am wondering why i am getting this error with the following
Hey all, so I'm trying to allow some text input which goes through a
Hey all, I'm trying to work on a simple script that takes a string
Hey all i am trying to figure out how to resize an image that
Hey all i am trying to delete a key from the registery but i
Hey all I'm trying to make a 3d game in with 2d sprite characters.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.