Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create a calculated field
Message
From
01/10/2002 16:49:07
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
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:
00706596
Views:
23
>Maybe I need to explain further.
>
>table1.Field1 & table1.Field2 together make up my primary key for that table.
>
>str(field1)+'.'+str(field2) is my primary key.
>
>
>I have another table that has that key value stored in a field .
>table2.field1=(str(table1.field1))+'.'+(str(table1.field1))
>
>I need to create a relation. The only relation it will allow me to create in the DE is by making table2 the parent. This will not work for me, I need table1 to be the parent table. It wont let me create that relation. Because there is not field, just an index in that table.
>
>So I thought If I could create an additional field that was calculated in table1, I could use it for the parent relation.
>
>Maybe there is another solution??

Well, you could consider using sequential numbers for your primary keys. This would allow you (in most cases) to have a single field (4 bytes) as both the primary key and the foreign key. This would save space, and simplify relations. There are also some disadvantages (see my article on primary keys, in the UT Magazine), but I still prefer to use these "auto-incremented" fields as primary keys.

If you prefer to stay with your current primary keys, I am not sure about relations - I never had to create this sort of relation. Well, perhaps you should do this programmatically, through the SET RELATION command. The relation is from any expression, to a table (active index is used), so you should have no problems here.

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform