OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

How do I get 1:n relations in Openoffice.org Base?

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base
View previous topic :: View next topic  
Author Message
supermin
General User
General User


Joined: 11 Mar 2012
Posts: 5

PostPosted: Mon Mar 12, 2012 6:42 am    Post subject: How do I get 1:n relations in Openoffice.org Base? Reply with quote

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
View user's profile Send private message
brian4m
OOo Enthusiast
OOo Enthusiast


Joined: 13 Feb 2006
Posts: 160
Location: Bath, England

PostPosted: Tue Mar 13, 2012 8:19 am    Post subject: Reply with quote

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
View user's profile Send private message
keme
Moderator
Moderator


Joined: 30 Aug 2004
Posts: 2732
Location: Egersund, Norway

PostPosted: Tue Mar 20, 2012 5:51 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group