Relationships (1:1)

A place for users and developers of the Xataface to discuss and receive support.

Relationships (1:1)

Postby wisni1rr » Tue Feb 14, 2012 3:19 pm

Hi again,

I am wondering how you can incorporate a 1to 1 relationship with xataface? I have several 1to 1 relationships in my current access project that I am converting to mySQL. I'm not sure how I should approach the situation...

Thanks for any advice you can provide!
wisni1rr
 
Posts: 107
Joined: Mon Feb 13, 2012 9:03 pm

Re: Relationships (1:1)

Postby samhans » Tue Feb 14, 2012 6:12 pm

very easy. just look at the tutorial in the documentation part.
if you find any problem then come back.
samhans
 
Posts: 96
Joined: Fri Feb 10, 2012 1:22 am

Re: Relationships (1:1)

Postby wisni1rr » Tue Feb 14, 2012 6:53 pm

Thanks for helping,

I went through the tutorial. It gives great examples for "1 to many" and "many to many" but I don't gather how to do a "1 to 1" relationship. Consider the following:

[TableA]
ID = INT(11) Auto_Increment, Primary

[TableB]
ID = INT(11)

For every record in [TableA] there can be exactly ONE OR NONE record in [TableB]

Could this be achieved by making ID in [TableB] unique?
wisni1rr
 
Posts: 107
Joined: Mon Feb 13, 2012 9:03 pm

Re: Relationships (1:1)

Postby samhans » Tue Feb 14, 2012 11:10 pm

could you explain more.

do you want any connection between table A and table B to be displayed in table A. or you just want that the id field of the table B to be filled from table A automatically.
samhans
 
Posts: 96
Joined: Fri Feb 10, 2012 1:22 am

Re: Relationships (1:1)

Postby shannah » Wed Feb 15, 2012 9:46 am

1:1 relationships currently are a bit tricky to deal with. I've had this on my list for a while but haven't gotten around to it. You can muddle around with regular relationships and kind of fudge it in there, but we really need to have a special case for 1:1.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Relationships (1:1)

Postby wisni1rr » Wed Feb 15, 2012 12:08 pm

Thanks for you help!

I've decided to make a 1:many relation and set my many table to have its connecting record Index as Unique.

Thanks again!
wisni1rr
 
Posts: 107
Joined: Mon Feb 13, 2012 9:03 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 14 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved