Book a Demo

Author Topic: Foreign Keys  (Read 2675 times)

Chris

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Foreign Keys
« on: September 09, 2003, 02:38:35 pm »
EA version: 3.60.639

In the foreign key constraint dialog for an Association, I tried to create a foreign key by matching the fields up and clicking ok and I get:

---------------------------
EA
---------------------------
Target columns must match
target primary key domain
---------------------------
OK  
---------------------------

It makes sense to match the fields and click ok.. but OK or "Save" both result in the above dialog.

What is the right way to create a foreign key?

The reason I'm trying to create one is so there is something there when I associate the tables.


hd

  • EA Administrator
  • EA User
  • *****
  • Posts: 312
  • Karma: +0/-0
    • View Profile
Re: Foreign Keys
« Reply #1 on: September 09, 2003, 04:04:07 pm »
The error message is raised because the foreign key domain must map to a primary key domain.  That is, the number of foreign key fields and their datatypes must match the number of primary key fields and their datatypes in the referenced table.


Chris

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Foreign Keys
« Reply #2 on: September 10, 2003, 01:02:01 pm »
What is a domain and where do you set it? I have to have equal amounts of PK/FK's?

I was trying to create a foreign key.. you select matching fields in either table and click ok.. if there are pre-requisites why doesn't the problem tell me instead of a vague message?
« Last Edit: September 10, 2003, 01:38:12 pm by Chris »