Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Maybe REFRESH() is not as inefficient as REQUERY()? If buffered, get Primary Key value from CURVAL()
Carlos
>How should the following situation be handled?
>
>The primary key in a table is assigned through a function, through its default value.
>
>In a parameterized view (local view), the primary key field is marked as a primary field, and is not updatable. All other fields are updatable.
>
>When the user creates a new record (the datasource is the local view), and saves it, the table receives its PK correctly (through the default value), and all other fields get updated correctly. However, the PK in the view still has the value zero, since no data is returned from the view to the table. Therefore, if the user does changes to the newly created record, these changes can't be saved, since the PK is invalid. There are also a few other problems, related to the missing PK in the view.
>
>If, on the other hand, the user closes the form (the one that uses the p-view) and opens it again, the data is read correctly, and the record can be saved. Also, I might do a requery(); but it seems inefficient to requery() the entire set of data every time a single record is saved (only for new records). I thought there must be another way.
>
>I think there might be some bad design in the structure explained above, but I can't spot it.
>
>TIA,
>
>Hilmar.
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