Book a Demo

Author Topic: Problem with Foreign Keys  (Read 3372 times)

becklesd

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Problem with Foreign Keys
« on: October 06, 2004, 12:13:22 pm »
I am a new user, working with EA version 4.10.738, Build 738, and am unable to get EA to put more than one foreign key in a table correctly. The symptoms are:
1. Not being able to set the target column in the Foreign Key Constraint dialog box.
2. The target role tab of the Association Properties dialog box does not get set, and if I set it manuallythe wrong column is displayed in the link label.
3. The generated DDL contains only the first foreign key.

I have checked the FAQ but could not find anything about how to get around this problem, and would be glad for some suggestions.


spfiore

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Problem with Foreign Keys
« Reply #1 on: October 13, 2004, 09:37:18 am »
It’s a little hard to tell from your post, but it looks like you might be trying to add the forieign keys in the wrong place.

The technique I've been using is to right click on the relationship line and select Foreign Keys. From the dialog that pops up I have been able to create a variety of FKs.

There are a couple of by-design quirks that it might help to know about if you’re new to EA:

* If you come from a RDBMS (versus a OOP) background the association relationship seems backward from how you would create a typical ER diagram in IDEF or the likes – I found myself removing the arrow heads (make direction unspecified) to avoid confusion.

* The sequence for creating keys and assigning data types can make a huge difference. Creating association tables is one example, creating Primary Foreign Keys based on auto-increment type fields is another. If you’re running into either of these let me know and I’ll elaborate.

Hope this helps.  

becklesd

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Problem with Foreign Keys
« Reply #2 on: October 24, 2004, 03:31:34 am »
Thanks for the help. I find that I can manage now, using the technique that you have suggested.

I'd be grateful if you could enlarge on your remark about creating Primary Foreign Keys based on auto-incrementing fields as that is something I will be having to do a lot of.