title: A foreign key value has no matching primary key value
body: <p>why do i get </p>
  
  <pre><code>Error report:
  SQL Error: ORA-02291: integrity constraint (FAUZI.NIL_NIM_FK) 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. ?
  </code></pre>
  
  <p>This is the structure of the database table :</p>
  
  <p><a href="https://i.stack.imgur.com/4TAhB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4TAhB.png" alt="enter image description here"></a></p>
  
  <pre><code>    alter table nilai
  add
  ( 
  constraint nil_kd_makul_fk foreign key(kd_makul) references 
  makul(kd_makul),
  constraint nil_nim_fk foreign key(nim) references mahasiswa(nim)
  on delete cascade
  )
  </code></pre>
  
  <p>insert into makul</p>
  
  <p>select 'A1','Jarkom',4,4 from dual</p>
  
  <p>union all</p>
  
  <p>select 'A2','Keamanan Data',3,5 from dual</p>
  
  <p>union all</p>
  
  <p>select 'A3','Jarkom 2',4,4 from dual</p>
  
  <p>/</p>
  
  <pre><code>NAMA                           JURUSAN                        TGL_LAHIR                 JK ALAMAT                         STATUS               NIM                  
  ------------------------------ ------------------------------ ------------------------- -- ------------------------------ -------------------- -------------------- 
  mas mas                        SI                             21-01-1994                                                                       123                  
  fauzi                          TI                             14-09-1991                                                                       124                  
  zainn                          EKONOMI                        03-03-2014        
  </code></pre>
  
  <p>i get error, then i write syntax :</p>
  
  <pre><code>insert into nilai
      select 'A1','123',60,70,80 from dual
      union all
      select 'A2','124',30,100,90 from dual
      union all
      select 'A3','125',40,80,70 from dual
      /
  </code></pre>
  
  <p>an error :</p>
  
  <pre><code>  Error report:
      SQL Error: ORA-02291: integrity constraint (FAUZI.NIL_NIM_FK) 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.
  </code></pre>