Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Question about views
Message
De
30/04/2006 00:09:13
 
 
À
29/04/2006 22:43:21
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:
01117864
Vues:
18
>>>>In MereMortals framework the PK are calculated in the view.
>>>
>>>Interesting. I assume that all data access is done through views, right?
>>
>>Hilmar, have you read my post?
>>
>>"No Problem, if you open the table directly, the User Defined Function call stored in the default value for the Primary key Field of the table is triggered. If you open table thru View, the same User Defined Function call will be made, this time from the View. Try it, I did."
>>
>>If you have the same UDF call as default value in the view and the table, you can use the view or the table directly, so its irrelevant if you just use always the view or sometimes the view and sometimes the table.
>>
>>Tal vez no me hago entender muy claramente en inglés, puede ser eso.
>>
>>Carlos
>
>Wouldn't there be a conflict here? I would guess that the table first assigns one value through the primary key, and then the view assigns another, different, value. Or would the assignment in the view not allow the default value in the table to be invoked?

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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform