Composite PK, restricting the values for the 2nd column of the FK in the child table

User, date Message
Written by mickael28
3 years ago
Category: Feature discussion
1 posts since Thu, 09 Feb 12
Hi guys,

I was using the front end to populate a child table linked to the one below where PK=grp+id

| grp* | id*| name |
| fish | 1 | lax |
| mammal | 1 | dog |
| mammal | 2 | cat |
| mammal | 3 | whale |
| bird | 1 | penguin |
| bird | 2 | ostrich |

And the problem I've encountered is that the front end doesn't restrict the value you can enter in the 2nd column depending on what you've already choosing for the 1st column of the FK.

For example, in the child table I wanted to use a FK of fish & 1 (as 1 is the only value in the table above) and heidiSQL front end displayed me 1, 2 and 3 once I've already selected 'fish' for the 1st column and then it even accepted 3 as the value for the 2nd column (when I was expecting that to fail) :S

Is there a way to restrict the values that are displayed on the 2nd column depending on what you've already selected for the 1st?

Many thanks!

Please login to leave a reply, or register at first.