Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updating remote views, a primary key problem
Message
De
09/12/1998 07:26:53
 
 
À
08/12/1998 09:55:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00165045
Message ID:
00165472
Vues:
18
I think that would be dangerous; another user might "get there first" and use MyKeys.NextVal for his own new record...

>Let's assume that you will eventually use an Oracle sequence to generate the primary keys (lets call the sequence MyKeys). Before INSERTing a new record, you can query MyKeys.nextval to see what primary key will be assigned by the INSERT and there will be your "pointer" to the new record.
>
>>I am developing an app which will eventually be upsized to an Oracle database. I am using local views in my prototype for upsizing ease.
>>
>>I have a form which calls a class to insert a new record into a table. Then I return to the original form and update the object (a Dropdown list) with the new record. I want the new record to show in the Dropdown list object.
>>
>>I use a procedure in the DBC to create the primary key field value. TABLEUPDATE() will cause the procedure to run and fill in the value in the remote data, but only a REQUERY() will return the value of the key field to the view. The view is parameterized and ordered. There are no other candidate keys within the table.
>>
>>How would I return the pointer on the view to the added record without knowing what the new key is? Or, rephrasing it, how do I find out what the key value of the new record is, without REQUERY()?
>>
>>If I were using a VFP native DBC, I would call the procedure to get the new key before the TABLEUPDATE(). Can I still do that, even though it's going to an Oracle database?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform