title: oracle sql: not able to add foreign key to table -> invalid identifier?
body: <p>First off, I'm a real newbie to db and sql. However, I have to tables, PERSON and SPECIES and I want to add a foreign key to the table SPECIES. When trying to add the foreign key I always get the error message "ORA-900904: invalid identifier". I just can't figure out what I've done wrong and why it doesn't work?!?!</p>
  
  <p>This was my approach:</p>
  
  <p><strong>PERSON table and primary key</strong></p>
  
  <pre><code>create table person
  (
  name varchar2 (30),
  firstname varchar2 (30),
  persid number (8) not null
  )
  ;
  
  alter table person 
  add constraint person_pk 
  primary key (persid)
  ;
  </code></pre>
  
  <p><strong>SPECIES table and primary key</strong></p>
  
  <pre><code>create table species
  (
  speciesnamelat varchar2 (30),
  vartid number (8) not null
  )
  ;
  
  alter table Species
  add constraint species_pk
  primary key (vartid)
  ;
  </code></pre>
  
  <p>This part worked fine but the following didn't work:</p>
  
  <p><strong>Foreign Key for SPECIES referring to PERSON</strong></p>
  
  <pre><code>alter table species
  add constraint species_person_fk
  foreign key (persid)
  references person (persid)
  ;
  </code></pre>
  
  <p>I always get this Error "ORA-900904: invalid identifier"</p>