title: How to add foreign key to a usera.table from a userb.table?
body: <p>I am new to Oracle, I have tried to add a foreign key <code>&quot;SupplyMGR&quot;.&quot;SUPPLIES&quot;</code>  to an <code>&quot;OrderMGR&quot;.&quot;USEDIN&quot;</code>.</p>
  <p>But I am getting the following error</p>
  <blockquote>
  <p>ALTER TABLE &quot;SupplyMGR&quot;.&quot;SUPPLIES&quot; ADD CONSTRAINT OrderMGR_fk FOREIGN KEY (ORDERNO) REFERENCES &quot;OrderMGR&quot;.&quot;USEDIN&quot;(ORDERNO)</p>
  <p>Error report<br />
  ORA-00922: missing or invalid option<br />
  00922. 00000 -  &quot;missing or invalid option&quot;<br />
  *Cause:<br />
  *Action:</p>
  </blockquote>
  <p>Code:</p>
  <pre><code>ALTER TABLE &quot;SupplyMGR&quot;.&quot;SUPPLIES&quot; 
      ADD CONSTRAINT OrderMGR_fk 
          FOREIGN KEY (ORDERNO) REFERENCES &quot;OrderMGR&quot;.&quot;USEDIN&quot;(ORDERNO);
  </code></pre>
  <p>All tables created.
  <strong>&quot;SupplyMGR&quot;.&quot;SUPPLIES&quot; Table</strong></p>
  <pre><code>+-----+--------------+---------------+-------------------+-----+-----+
  | SID | SDESCRIPTION | AMOUNTINSTOCK | SEPTUSAGE         |STYPE|ORDERNO
  +-----+--------------+---------------+-------------------+-----+-----+
  |   1 | desc2        |             3 |                20 | 200 |
  |   2 | desc1        |           300 |                10 |  30 |
  +-----+--------------+---------------+-------------------+-----+-----+
  </code></pre>
  <p><strong>&quot;OrderMGR&quot;.&quot;USEDIN&quot; Table</strong></p>
  <pre><code>+---------+--------------+----------+--------------+-------+---------+
  | ORDERNO | SDESCRIPTION | SUPPLIES | QUANTITYUSED | STYPE | BIGJOBS |
  +---------+--------------+----------+--------------+-------+---------+
  |    9001 | desc2        |       20 |           10 | type1 | Bigjob1 |
  |    9002 | desc1        |       30 |           20 | type2 | Bigjob2 |
  +---------+--------------+----------+--------------+-------+---------+
  </code></pre>
  <p>Kindly help</p>