Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I get all records from left join in this Select -
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00355646
Message ID:
00356672
Views:
15
>Hi Larry,
>
>>>Are you saying that there are many records in the Servcalls table with the same value in Prim_Key? If so, then Prim_Key is not a primary key as I thought from the name. It is the foreign key of Customers. <<
>
>Help me out here, I used the name prim_key because the key is a unique one to the customer generated by a 3rd party framework for the parent and child. However, I had the choice of name and I always thought the parent and child fields where suppose to have the same name when they where to be used to set a one to many relation.
>
>Should the field names be different?
>
The actual field names mean very little in the great scheme of things except for documentation. Third-party ERD tools like Erwin and xCase use the name from the parent table in the child table when defining foreign keys. If you look at SQL Server or Oracle tables, you will see alot of the this internal documentation.

The VFP database designer doesn't do this. You have to have an already existing index in the child table to create a relation to it. Because of this, the field already exists with the naming scheme you used for that table. In my case, I like to use a 3 letter designation for the table as a field name prefix. This way, if I look at a column report, I know what table each field belongs to. I also use _pk to designate primary keys and _xxxfk to designate foreign key fields. So you see the name really doesn't mean anything.

I have one question. Since you are using Prim_Key to designate the primary key in the customer table and you are using that name also to designate the customer foreign key in the servcalls table, what is the name of the primary key in the servcalls table?
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform