Book a Demo

Author Topic: Foreign key question  (Read 2333 times)

allegatok

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Foreign key question
« on: October 31, 2003, 09:07:39 am »
Hello,
I'm just a EA newbie who got a problem with
the foreign key management. In my tests
to understand the mechanics I have
been trying to create a Data Model with two
tables and link one table to another. On one table
I defined two columns as primary key (pk1, pk2) with same type and size. On the other I defined two fields
(fpk1, fpk2) same type and sizes. Now I just wanted to
link and have fpk1 to point to pk1 and fpk2 to pk2.
I didn't understand how to achieve such a thing.
The generated DDL actually gives with the fields
not properly ordered.

ALTER TABLE Table1 ADD CONSTRAINT FK_Table1_Table2
FOREIGN KEY (fpk2, fpk1) REFERENCES Table2 (pk1, pk2)
;

Is something I don't do good or may be a bug?
Thank you
Mario