title: Referencing multiple primary keys in another table
body: <p>I am using DB2 to to create some tables.  I have 2 tables that look like this:</p>
  
  <pre><code>create table TEST_TABLE1
  /* */
  (
  PRIMARY_COLUMN1 int not null,
  PRIMARY_COLUMN2 varchar(50) not null,
  primary key (PRIMARY_COLUMN1,PRIMARY_COLUMN2)
  );
  
  create table TEST_TABLE2
  /* */
  (
  PRIMARY_COLUMN1 int references TEST_TABLE1(PRIMARY_COLUMN1) not null,
  PRIMARY_COLUMN2 varchar(50) references TEST_TABLE1(PRIMARY_COLUMN2) not null,
  primary key(PRIMARY_COLUMN1,PRIMARY_COLUMN2)
  );
  </code></pre>
  
  <p>When I try to add the tables, I get this error:</p>
  
  <pre><code>SQL0573N  A column list specified in the references clause of constraint 
  "PRIMARY_COLUMN1..." does not identify a unique constraint of the parent table 
  or nickname "DB2INST1.TEST_TABLE1".  SQLSTATE=42890
  </code></pre>
  
  <p>Does anybody know how I can get TEST_TABLE2 to reference TEST_TABLE1?</p>
  
  <p>I have also tried to create TEST_TABLE2 like this and got the same error:</p>
  
  <pre><code>create table TEST_TABLE2
  /* */
  (
  PRIMARY_COLUMN1 int references TEST_TABLE1(PRIMARY_COLUMN1) not null,
  
  primary key(PRIMARY_COLUMN1)
  );
  </code></pre>
  
  <p>Thanks,
  Justin</p>