Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Hi, Joe-
>I been trying to figure this out for some time and now I can duplicate
>it. The problem is caused by the updating the field in the table when
>it has an index. Remove the index (or don't update the index field)
>and everything works ok.
>
>Is this a bug?
No, but it sure was a good puzzle. The problem, basically, is that you have both the view and the table the view is based on, buffered. If you close test before using your view (and remove the CursorSetProp for it), then your code works fine. Or, if you TableUpdate Test after the first TableUpdate of View1, your code works fine. I don't know the mechanics of why the view record gets deleted after the second update. Suffice it to say...don't do that. *g*.
Rule of thumb, don't buffer (don't even open if you don't have to) the tables views are based on. Using the view is enough.
That was a good puzzle--would be a heck of an prospective employee question. Nice that you included a runnable example. Thanks.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement