Table structure?

Joakim Schramm joakim at astrocalc.com
Sat Apr 29 16:19:38 CDT 2006


 

> -----Original Message-----
> From: valentina-bounces at lists.macserve.net 
> [mailto:valentina-bounces at lists.macserve.net] On Behalf Of 
> Ruslan Zasukhin
> Sent: 29 April 2006 15:46
> To: valentina at lists.macserve.net
> Subject: Re: Table structure?
> 
> On 4/29/06 1:51 AM, "Joakim Schramm" <joakim at astrocalc.com> wrote:
> 
> > I am still a bit confused about this. From example below of linking 
> > records
> > 
> > Private Sub LinkRecords()
> > 
> >   Dim mLink As VLink
> >   Dim recs(1) As Variant
> >   
> >   ' get link object by name
> >   Set mLink = mDatabase.Link("link_person_phone")
> >   
> >   'in this method assign values to ObjectPtr field to link records
> >   ' of 2 tables in this way:
> >   ' 1 - 1
> >   ' 1 - 3
> >   ' 2 - 4
> >   ' 3 - 2
> >   
> >   ' 1 - 1
> >   recs(0) = 1
> >   recs(1) = 1
> >   mLink.LinkRecords (recs)
> >   
> >   ' 1 - 3
> >   recs(0) = 1
> >   recs(1) = 3
> >   mLink.LinkRecords (recs)
> >   
> >   ' 2 - 4
> >   recs(0) = 2
> >   recs(1) = 4
> >   mLink.LinkRecords (recs)
> >   
> >   ' 3 - 2
> >   recs(0) = 3
> >   recs(1) = 2
> >   mLink.LinkRecords (recs)
> >   
> > End Sub
> > 
> > Here we from human conception which number belong to which 
> person, but 
> > computer don't have that conception.
> 
> right
>  
> > Isn't it that each record or pair of records need to be 
> linked right 
> > after they are added or we don't know relation if first filling one 
> > table then next etc.?
> 
> Right.
> 
> > I am here talking about I am going to read lots of data from other 
> > source, from 3 "tables". So I must either link while they are in 
> > "memory" or I need to store a temp pointer in memory bank 
> (e.g. array) 
> > for later use - is this correct?
> 
> > As data comes from 3 sources interacting with each other I 
> can't just 
> > do it all at one time as one depends on the other and the third 
> > depends on the first... Must be that way, right?
> 
> I already have point how to **CONVERT** your existed db.
> 
> 1) as first step you can make in Valentina THE SAME relational fields.
> 
> 2) import your data AS IS
> 
> 3) write and run ONCE function to link records using 
> BinaryLink with help of info of YOUR old fields
> 
> 4) DROP that OLD fields
> 
> Now you have correct database with BinaryLinks.
> 
> ------------------------------
> HOW TO LINK future records?
> 
> As far as I see EASY.
> 
> * you show to use list of places, right?
> 
> * user click some place -- now you know RecID of select record. Right?
> 
> * you add new record into T2 - and you also get its RecID.
> 
> * now you simple do
> 
>     binaryLink.LinkRecords( recid1, recid2 )
> 
> 
> P.S. in the next beta build we will introduce this function 
> to link 2 records, it will be more comfortable than using arrays now.
> 
Yes that's the simple way! Didn't realized I could drop the fields when done
with them. No I see what's behind what have become my favourite phrase in
your documentation "I is easy to see..." :-)

During the day I have come a bit further, but working with loading data into
arrays to keep things in "memory", that works as well but not as easy.
However, there is a new more complications I have come cross as when I
rebuild the database now I also like to deal with some short comings from
before, like countries and places can have alternative names and also
differs in different languages.

If I have understood it right, if you have a 1:M between T1 & T2 two or more
items in T1 can't have BinaryLinks to same items in T2, I need a M:M
relation for that, right? However, when most records on left side really are
like 1:M you don't want to setup a M:M just to cope with the few. I am
trying to deal with this by creating an alias table holding the alternative
items, and with BL I think that can be easy to work, hopefully. But I am
still learning this new tool so just have to experiment.

It is hard to break old habbits! I just have a support case for one of my
program where the customer want to have her "old" program back as the new
works differantly, and you know when users get frustrated how much useful
info you get from them :-)

Joakim
> 
> --
> Best regards,
> 
> Ruslan Zasukhin
> VP Engineering and New Technology
> Paradigma Software, Inc
> 
> Valentina - Joining Worlds of Information http://www.paradigmasoft.com
> 
> [I feel the need: the need for speed]
> 
> 
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina
> 



More information about the Valentina mailing list