Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create a calculated field
Message
De
03/10/2002 11:23:33
 
 
À
01/10/2002 16:37:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00706493
Message ID:
00707355
Vues:
19
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform