title: Error creating DB2 Foreign Key
body: <p>Table1:</p>
  
  <pre><code>Column    Primary Key    Generated
  COL1      *              *
  COL2      *
  COL3      *
  COL4      
  </code></pre>
  
  <p>Table2:</p>
  
  <pre><code>Column   Primary Key    Generated
  CCOL1
  CCOL2
  </code></pre>
  
  <p><code>CCOL1</code> in <code>Table2</code> is reference to <code>COL1</code> in <code>Table1</code>. I want to create foreign key for CCOL1 in Table2</p>
  
  <pre><code>ALTER TABLE TABLE2
    ADD CONSTRAINT CCOL1_FK
      FOREIGN KEY (CCOL1)
          REFERENCES TABLE1(COL1)
      ON DELETE RESTRICT
  </code></pre>
  
  <p>Then getting this error message:</p>
  
  <blockquote>
    <p>A column list specified in the references clause of constraint
        "CCOL1_FK" does not identify a unique constraint of the parent
        table or nickname "TABLE1".. SQLCODE=-573, SQLSTATE=42890, DRIVER=4.18.60</p>
  </blockquote>
  
  <p>It's clear but how do I connect <code>CCOL1</code> to <code>COL1</code>? I want restrict deletions from <code>TABLE1</code> if there is still <code>CCOL1</code> used in <code>TABLE2</code></p>