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 3485760
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:56:47+00:00 2026-05-18T10:56:47+00:00

Hi I am developing a database in Oracle SQL dev, that is trying to

  • 0

Hi I am developing a database in Oracle SQL dev, that is trying to access foriegn keys from another table. I am currently working on the ItemOrdered table which I’ve created with the following CREATE statement

CREATE TABLE ItemOrdered(OrderID varchar2(9) REFERENCES Ords(OrderID),
BeltID varchar2(9) REFERENCES BeltID(BeltID), 
Quantity varchar(4) NOT NULL,
PRIMARY KEY(OrderID, BeltID))

As you can See I have the following foriegn keys Ords and BeltID.

Now when I try to run the following statement

INSERT INTO ItemOrdered VALUES(401565981,234489212,'2')

It gives me the following error

violated – parent key not found
02291. 00000 – “integrity constraint (%s.%s) violated – parent key not found”

I have provided my Ords CREATE statement if its needed

  CREATE TABLE Ords(OrderID varchar2(9) PRIMARY KEY, 
CustomerID varchar(9) REFERENCES Customers(CustomerID), 
    Expected_Delivery_Date date DEFAULT sysdate NOT NULL, 
Actual_Delivery_Date date DEFAULT sysdate NOT NULL, 
    Payment_Due_Date date DEFAULT sysdate NOT NULL, 
Order_Date date DEFAULT sysdate NOT NULL, Price Varchar(10), 
    Order_Placed varchar2(1) CONSTRAINT OrderPlaced 
CHECK(Order_Placed IN('Y','N')) NOT NULL, 
Order_Confirmed varchar2(1)
    CONSTRAINT Order_Confirmed CHECK(Order_Confirmed IN('Y','N')) NOT NULL, 
Order_Completed varchar2(1) CONSTRAINT Order_Completed
    CHECK(Order_Completed IN('Y','N')) NOT NULL)

And I have also provided my BeltID CREATE statement

    CREATE TABLE BeltID(BeltID varchar2(9) PRIMARY KEY, 
BeltLengthID varchar2(9) REFERENCES BeltLength(BeltLengthID), 
    ColourID varchar2(9) REFERENCES Colour(ColourID), 
DesignID varchar2(9) REFERENCES Design(DesignID),ComponentID varchar2(9) REFERENCES Component(ComponentID))

I don’t seem to quite understand why I am getting this error. Is there an clear explanation why?

Here is the http link of what I am trying to do.
link text

  • 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-05-18T10:56:47+00:00Added an answer on May 18, 2026 at 10:56 am

    Due to the foreign key constraints you specified when you created table ItemOrdered, when you perform this insert:

    INSERT INTO ItemOrdered VALUES(401565981,234489212,'2')
    

    … the values 401565981 and 234489212 must correspond to key values in the Ords and BelitId tables respectively – i.e. these 2 queries should return rows:

    select *
    from Ords
    where OrderId = 401565981;
    
    select *
    from BeltId
    where BeltId = 234489212;
    

    The error message suggests this is not the case.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing an Access 2003 Database that uses a MS SQLServer backend. I'm trying
I'm currently developing a PHP application that's using an Access database as a backend.
I'm developing an iPhone app that uses the built-in SQLite database. I'm trying to
I am currently developing a Rails application using a database that was designed before
I am developing an application which will be connected to Access database at the
I am developing an iPhone application that persists data to a SQLite3 database. For
I am developing RoR application that works with legacy database and uses ActiveScaffold plugin
I have been tasked with developing a solution that tracks changes to a database.
I am developing a small business application which uses Sqlserver 2005 database. Platform: .Net
My team is developing a large java application which extensively queries a MySQL database

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.