Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
>>>>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
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