Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem in view
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00216702
Message ID:
00217157
Views:
21
>>>Vinod,
>>>
>>>If you want to use a view to update a table that table must have a primary key. There's no way around that. You could get rid of the view and update the table directly using buffering.
>>
>>Actually you can - just create a simple test and see
>>
>>Arnon
>
>Arnon,
>
>Yes, you can create a view on a table that doesn't have a primary key, but the results are not exactly desireable. The problem Vinod was having was caused because he used a foreign key instead. When he deleted one record with a given foreign key value, all records with that value were deleted.

Arnon and Vinod,

I think I need to clarify what I'm saying here. It doesn't matter whether any field in your table is defined as a primary key. What does matter is that you have to have a field or combination of fields that's unique for each record. You could mark all the fields as part of the key if you know that each record will be unique. That might not give you great performance, but it will work as long as you don't have any duplicate records.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform