[Lazarus] SQLite: Several foreign keys

Luiz Americo Pereira Camara luizmed at oi.com.br
Wed Oct 15 02:57:53 CEST 2008


Usuario AnĂ³nimo wrote:
> If I want to create a simple master/detail relationship of 
> one-to-many, it is easy:
>
[]
>
> But, if I want to create a master/detail relationship of one-to-many 
> with several foreign keys, how I do it?
>
> For example I want to create this relationship:
>
> Contact: [u]Code[/u], Name <-- Master table
> Company: [u]Code[/u], Name <-- Master table
> Phone: [u]Number[/u], Contact, Company (Contact and Company are 
> foreigns keys) <-- Detail table
>
> How I do it?

What is the application design?
You will have a Contact grid and a Company grid in the same window 
sharing the same Phone table/grid?
Or you will have a window with Contact + Phone and other window with 
Company + Phone?

Luiz





More information about the Lazarus mailing list