Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create a calculated field
Message
From
03/10/2002 11:23:33
 
 
To
01/10/2002 16:37:37
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00706493
Message ID:
00707355
Views:
18
I have created

table1.fset N(10, 0)
table1.ftnum N(10, 0)

Primary Key
PK = str(fset) + "." + str(ftnum)


table2.fsetfnum && combined C(21)

Primary Key
PK = fsetnum


The relationship worked. If we are going from PK to PK then what we have initially is a one to one relationship. I believe the key to the solution is in your indices.

If table1.fset + table1.ftnum = table2.fsetfnum and table1(PK) = table2(PK) then you have a one to one relationship.

If table1.fset + table1.ftnum = table2.fsetfnum and table1(PK) = table2(regular) then you have a one to many relationship.


Personally, I would have used a numeric key as you describe above but combine the two fields in the following way:

table1.field1 B(8,3) && Double where "3" is the maximum length of ftnum.

table2.field1 B(8,3)

Where the integer portion of field1 is equal to fset and the decimal portion is equal to ftnum and your indices remain as numeric and fast.
Gordon de Rouyan
DC&G Consulting
Edmonton, Alberta
Email: derouyag@shaw.ca
Previous
Reply
Map
View

Click here to load this message in the networking platform