title: Why is parent key not found?
body: <p>When I insert data into the ASSIGNMENTS table it all works fine except for the HARDWARE and SOFTWARE values, which are coded exactly in the same way as the others. I just don't get it.</p>
  
  <p>This works:</p>
  
  <pre><code>INSERT INTO ASSIGNMENTS (ASSIGNMENT_ID, PROJECT_ID, STAFF_ID, JOB_ID)
  VALUES ('A0005','B0002','ST002','J0002');
  </code></pre>
  
  <p>But when I try to include values for HARDWARE or SOFTWARE, like this:</p>
  
  <pre><code>INSERT INTO ASSIGNMENTS (ASSIGNMENT_ID, PROJECT_ID, STAFF_ID, JOB_ID, HARDWARE_ID)
  VALUES ('A0005','B0002','ST002','J0002','H0002');
  </code></pre>
  
  <p>I just get the following error: 
  SQL Error: ORA-02291: integrity constraint (JAS1224.SYS_C0028418) violated - parent key not found
  02291. 00000 - "integrity constraint (%s.%s) violated - parent key not found"
  *Cause:    A foreign key value has no matching primary key value.
  *Action:   Delete the foreign key or add a matching primary key.</p>
  
  <p>Here is all the code, and all of the tables have been populated correctly (the hardware and software tables are coded in exactly the same format as the staff table):</p>
  
  <pre><code>CREATE TABLE PROJECT
  (PROJECT_ID CHAR(5) NOT NULL,
  PROJECT_NAME CHAR(20),
  PROJECT_TYPE CHAR(20),
  START_DATE DATE,
  END_DATE DATE,
  PRIMARY KEY (PROJECT_ID));
  
  CREATE TABLE HARDWARE
  (HARDWARE_ID CHAR(5) NOT NULL,
  HARDWARE_NAME CHAR(20),
  PRIMARY KEY (HARDWARE_ID));
  
  CREATE TABLE SOFTWARE
  (SOFTWARE_ID CHAR(5) NOT NULL,
  SOFTWARE_NAME CHAR(20),
  PRIMARY KEY (SOFTWARE_ID));
  
  CREATE TABLE STAFF
  (STAFF_ID CHAR(5) NOT NULL,
  STAFF_NAME CHAR(20),
  PRIMARY KEY (STAFF_ID));
  
  CREATE TABLE JOB
  (JOB_ID CHAR(5) NOT NULL,
  JOB_TYPE CHAR(20),
  JOB_GRADE CHAR(20),
  PRIMARY KEY (JOB_ID));
  
  CREATE TABLE ASSIGNMENTS
  (ASSIGNMENT_ID CHAR(5) NOT NULL,
  PROJECT_ID CHAR(5),
  STAFF_ID CHAR(5),
  JOB_ID CHAR(5),
  HARDWARE_ID CHAR(5),
  SOFTWARE_ID CHAR(5),
  PRIMARY KEY (ASSIGNMENT_ID),
  FOREIGN KEY (PROJECT_ID) REFERENCES PROJECT(PROJECT_ID),
  FOREIGN KEY (STAFF_ID) REFERENCES STAFF(STAFF_ID),
  FOREIGN KEY (JOB_ID) REFERENCES JOB(JOB_ID),
  FOREIGN KEY (HARDWARE_ID) REFERENCES HARDWARE(HARDWARE_ID),
  FOREIGN KEY (SOFTWARE_ID) REFERENCES SOFTWARE(SOFTWARE_ID));
  </code></pre>