Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Retrieving Parent Primary Key for saving in a Child file
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00422476
Message ID:
00422487
Vues:
16
>I have a procedure to add a Integer based unique primary key in the Server Table whenever a new record is inserted via a TableUpdate command using remote views. This is called via a function assigned to the field's default value in the DBC. How can I retrieve this value so that I can save it as a foreign key in the corresponding new records in the child table before updating it.

One option would be to call your function manually before you issue TABLEUPDATE() and replace the field value in the remote view yourself. Since the field will already have a value, the DEFAULT constraint will be ignored.

You could also, create another parameterized remote view. Your table would have to have a candidate key in order for this approach to work. After you issue TABLEUPDATE(), fill the new remote view parameter with the new candidate key and requery the view. The view could return the newest PK.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform