Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Views and Keys
Message
From
07/02/1999 13:52:12
 
 
To
05/02/1999 08:26:18
Kenneth Downs
Secure Data Software, Inc.
New York, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00184295
Message ID:
00184883
Views:
17
>I got the impression from Rich and Erik that this is not usually done this way when dealing with views, but that keys are added in when a set of views (1:M:M...) are committed. What's the motivation for this? And Rich and Erik, if you're listening, does this make my earlier problem with orphaned grandkids go away?

Kenneth- you are correct in that I usually let the dbc handle the assigning of keys with the table's Default value property. Sometimes, however (as in your case), this isn't satisfactory, because I need to know the key of the record before I commit, or after I commit but before I requery the view. In these instances, I just cal lthe dbc's NewKey procedure in code, instead of waiting to let the table do it.

m.pk = NewKey('MyTable')

INSERT INTO MyView FROM MEMVAR

To finish answering your question- I can't say if the way you are doing it is more the norm or unusual- I can only give reasons for the way that I do it. I like to let the dbc handle it invisibly, so I odn't have to worry about it. Also, there are far fewer wasted keys (not that that is much of an issue with the number of integer available to us.)
Erik Moore
Clientelligence
Previous
Reply
Map
View

Click here to load this message in the networking platform