dbTalk Databases Forums  

ParadoxField?

comp.databases.paradox comp.databases.paradox


Discuss ParadoxField? in the comp.databases.paradox forum.



Reply
 
Thread Tools Display Modes
  #61  
Old   
Tom Krieg
 
Posts: n/a

Default Re: ParadoxField? - 04-24-2008 , 02:08 AM






Sorry, that should be

Relationships
Field1 RecordID (Meaningless Identifier)
Field2 PersonID - points to Persons record of this person
Field3 RelativeType - 1 = Father; 2 = Mother, 3 = Brother, 4 = Sister
Field4 RelativeID - points to PersonID of relative
Primary Key = RecordID
Secondary Index on PersonID + RelativeType + RelativeID (Unique)

You should also include son/daughter in the relative type.

In Paradox, I would make PersonID and RecordID fields meaningless long
Integers, in a MS SQL database a GUID would be suitable. The RecordID
field identifies a unique relationship of one person to one other
person. You wouldn't necessarily use this in your logic but Paradox
requires a unique primary key to have secondary indexes. You could, of
course, have a primary key of PersonID + Relative Type + RelativeID as a
compound key.

It's the PersonID key in the Persons table that has a relationship to
the PersonsID field in the Relationships table (1 -->>M) via the
secondary index (this links all immediate relatives 1 generation up, one
down and one sideways), and the RelativeID field in the Relationships
table relates back (1 --> 1) to the PersonID of the relative via the key
of the Persons table.

Through recursion, you can step through the database up, sideways or
down for as many levels as you want.

MichaelR (AT) niemand (DOT) org wrote:
Quote:
Hi,
yes it's recursion. But I suppose more than one level. I would take it
as fas as plausible data takes me.
In the Table Relationships.Field1 (PersonsID) which field type do you
take? That is my main problem.




--
Tom Krieg

---------------
http://www.krieg.com.au
Please use the contact page to contact me via email


Reply With Quote
  #62  
Old   
Tom Krieg
 
Posts: n/a

Default Re: ParadoxField? - 04-24-2008 , 02:08 AM






Sorry, that should be

Relationships
Field1 RecordID (Meaningless Identifier)
Field2 PersonID - points to Persons record of this person
Field3 RelativeType - 1 = Father; 2 = Mother, 3 = Brother, 4 = Sister
Field4 RelativeID - points to PersonID of relative
Primary Key = RecordID
Secondary Index on PersonID + RelativeType + RelativeID (Unique)

You should also include son/daughter in the relative type.

In Paradox, I would make PersonID and RecordID fields meaningless long
Integers, in a MS SQL database a GUID would be suitable. The RecordID
field identifies a unique relationship of one person to one other
person. You wouldn't necessarily use this in your logic but Paradox
requires a unique primary key to have secondary indexes. You could, of
course, have a primary key of PersonID + Relative Type + RelativeID as a
compound key.

It's the PersonID key in the Persons table that has a relationship to
the PersonsID field in the Relationships table (1 -->>M) via the
secondary index (this links all immediate relatives 1 generation up, one
down and one sideways), and the RelativeID field in the Relationships
table relates back (1 --> 1) to the PersonID of the relative via the key
of the Persons table.

Through recursion, you can step through the database up, sideways or
down for as many levels as you want.

MichaelR (AT) niemand (DOT) org wrote:
Quote:
Hi,
yes it's recursion. But I suppose more than one level. I would take it
as fas as plausible data takes me.
In the Table Relationships.Field1 (PersonsID) which field type do you
take? That is my main problem.




--
Tom Krieg

---------------
http://www.krieg.com.au
Please use the contact page to contact me via email


Reply With Quote
  #63  
Old   
Tom Krieg
 
Posts: n/a

Default Re: ParadoxField? - 04-24-2008 , 02:08 AM



Sorry, that should be

Relationships
Field1 RecordID (Meaningless Identifier)
Field2 PersonID - points to Persons record of this person
Field3 RelativeType - 1 = Father; 2 = Mother, 3 = Brother, 4 = Sister
Field4 RelativeID - points to PersonID of relative
Primary Key = RecordID
Secondary Index on PersonID + RelativeType + RelativeID (Unique)

You should also include son/daughter in the relative type.

In Paradox, I would make PersonID and RecordID fields meaningless long
Integers, in a MS SQL database a GUID would be suitable. The RecordID
field identifies a unique relationship of one person to one other
person. You wouldn't necessarily use this in your logic but Paradox
requires a unique primary key to have secondary indexes. You could, of
course, have a primary key of PersonID + Relative Type + RelativeID as a
compound key.

It's the PersonID key in the Persons table that has a relationship to
the PersonsID field in the Relationships table (1 -->>M) via the
secondary index (this links all immediate relatives 1 generation up, one
down and one sideways), and the RelativeID field in the Relationships
table relates back (1 --> 1) to the PersonID of the relative via the key
of the Persons table.

Through recursion, you can step through the database up, sideways or
down for as many levels as you want.

MichaelR (AT) niemand (DOT) org wrote:
Quote:
Hi,
yes it's recursion. But I suppose more than one level. I would take it
as fas as plausible data takes me.
In the Table Relationships.Field1 (PersonsID) which field type do you
take? That is my main problem.




--
Tom Krieg

---------------
http://www.krieg.com.au
Please use the contact page to contact me via email


Reply With Quote
  #64  
Old   
Tom Krieg
 
Posts: n/a

Default Re: ParadoxField? - 04-24-2008 , 02:08 AM



Sorry, that should be

Relationships
Field1 RecordID (Meaningless Identifier)
Field2 PersonID - points to Persons record of this person
Field3 RelativeType - 1 = Father; 2 = Mother, 3 = Brother, 4 = Sister
Field4 RelativeID - points to PersonID of relative
Primary Key = RecordID
Secondary Index on PersonID + RelativeType + RelativeID (Unique)

You should also include son/daughter in the relative type.

In Paradox, I would make PersonID and RecordID fields meaningless long
Integers, in a MS SQL database a GUID would be suitable. The RecordID
field identifies a unique relationship of one person to one other
person. You wouldn't necessarily use this in your logic but Paradox
requires a unique primary key to have secondary indexes. You could, of
course, have a primary key of PersonID + Relative Type + RelativeID as a
compound key.

It's the PersonID key in the Persons table that has a relationship to
the PersonsID field in the Relationships table (1 -->>M) via the
secondary index (this links all immediate relatives 1 generation up, one
down and one sideways), and the RelativeID field in the Relationships
table relates back (1 --> 1) to the PersonID of the relative via the key
of the Persons table.

Through recursion, you can step through the database up, sideways or
down for as many levels as you want.

MichaelR (AT) niemand (DOT) org wrote:
Quote:
Hi,
yes it's recursion. But I suppose more than one level. I would take it
as fas as plausible data takes me.
In the Table Relationships.Field1 (PersonsID) which field type do you
take? That is my main problem.




--
Tom Krieg

---------------
http://www.krieg.com.au
Please use the contact page to contact me via email


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.