Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Handling 1:M:M with views
Message
From
04/02/1999 17:04:33
Kenneth Downs
Secure Data Software, Inc.
New York, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Handling 1:M:M with views
Miscellaneous
Thread ID:
00184085
Message ID:
00184085
Views:
60
I'm sure this problem is so basic that it has been encountered before, so here goes:

Consider a 1:M:M situation in which views are being used exclusively. The child view at level 2 is parameterized on the parent's Surrogate key, and the grandchild view is likewise parameterized on the child's surrogate key. The basic idea is to do a cascading requery of views as the user navigates at any level.

The trouble comes when a user creates a new record at the parent level. Consider this scenario:
1. User creates new parent record
2. User adds a single child record to new, unsaved parent.
3. User adds grandchild records(s) to the new, unsaved child
4. User attempts to add a second child record.

BANG! What happens to the grandchild records? You can't save them because they'll be orphaned (or would that be grand-orphaned?)

It seems I have only these choices:
1. Don't exceed 1:M. Not really an option, IMHO.
2. Secretly save non-validated records, then delete them if the user cancels. Not a very pleasant prospect, either.
3. Force the user to save the parent. This also has problems of its own when business rules conflict with this requirement.

Like I said, I'm sure I'm not the first to run across this, so here's hoping there is some orthodox solution....

As always, TIA
Next
Reply
Map
View

Click here to load this message in the networking platform