Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Question about views
Message
De
08/05/2006 18:17:33
 
 
À
08/05/2006 17:45:52
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 6 SP5
Divers
Thread ID:
01117697
Message ID:
01120203
Vues:
19
This message has been marked as the solution to the initial question of the thread.
>>If you are using the view, the view "sees" the new record first, then it sends the update to the table when you do tableupdate or move record pointer or whatever...
>>
>>No conflict, "Default Value" property of table or view field is just that, a default value in case the field is empty at the time it is inserted in the view/table.
>>
>>If you do APPEND BLANK using the table, the UDF call of the table triggers
>>
>>If you do APPEND BLANK using the View, the UDF call of the view triggers, by the time the record "arrives" to the table, the PK field already has a value, its not blank, so the UDF call of the table does not trigger.
>>
>>Remember, "Default Value" triggers when the field is empty, so we dont get an empty field. Sometimes we forget the obvious...
>>
>>Carlos
>
>I tried this (putting my function SerialNumber() both in the table and in the view), and it turns out that both the view and the table fetch the primary key default value. Worse yet, the view gets the primary key value first, then the table overwrites that with a new value. Skipping values would not be a problem (the user doesn't see the primary key), but the view has the wrong value (not the same as the table), therefore, I still get the update conflict when I save a new record, make changes, and then save it again.

Did you check the field as updatable in the view? If you dont, what you describe will happen.

Carlos
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform