Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
Updating new parent key into child table
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
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