Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updating new parent key into child table
Message
De
20/12/2000 20:23:31
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Updating new parent key into child table
Divers
Thread ID:
00455723
Message ID:
00455723
Vues:
76
I have a corporation parent table with an executive child table. These are older tables that use a numeric 'corpid' to link the two tables. I want to update the primary key to use sys(2015). I added a new field in the parent table called ccorp_id with the new style key, and now I want to update all the child records with that new key.

For example: Parent Corp record has a corpid=1 and all the child record reference that corpid of 1 in the child table. I want to update the ccorp_id field in the child table to match the ccorp_id in the parent table.

I have tried to put together an update SQL that sets corp.ccorp_id=exec.ccorp_id (new key) where corp.corpid=exec.corpid (old key), but I just can't seem to get the syntax correct.

Can anyone help me with this?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform