| View previous topic :: View next topic |
| Author |
Message |
supermin General User

Joined: 11 Mar 2012 Posts: 5
|
Posted: Mon Mar 12, 2012 6:42 am Post subject: How do I get 1:n relations in Openoffice.org Base? |
|
|
I have made my tables, added all the primary keys and when I want to create relations between the tables I automatically get 1:1 relations. I need 1:n relations but I have no idea how to get them..
Deleted image link - floris v, moderator |
|
| Back to top |
|
 |
brian4m OOo Enthusiast

Joined: 13 Feb 2006 Posts: 160 Location: Bath, England
|
Posted: Tue Mar 13, 2012 8:19 am Post subject: |
|
|
Use Tools then Relationships then use the Add tables icon to see the available tables. Click on the tables you want to include. Then drag the key field from the 1 end to the related field in the many end. The 1:n will show clearly.
Another point. Click on the relationship line to see information on the relationship eg delete and update options.
Brian |
|
| Back to top |
|
 |
keme Moderator


Joined: 30 Aug 2004 Posts: 2732 Location: Egersund, Norway
|
Posted: Tue Mar 20, 2012 5:51 am Post subject: |
|
|
If the drag gives 1:1 relationships, it's probably because you connect primary key to primary key.
(For a given value, there can only be one record in a table having that value in the primary key.)
A foreign key should not be set as key, but only connect to corresponding key field in the linked table. |
|
| Back to top |
|
 |
|