Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating new parent key into child table
Message
From
20/12/2000 20:23:31
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Updating new parent key into child table
Miscellaneous
Thread ID:
00455723
Message ID:
00455723
Views:
74
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?
Next
Reply
Map
View

Click here to load this message in the networking platform