Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

new table data migration

Status
Not open for further replies.

jemminger

Programmer
Jun 25, 2001
3,453
US
here's the scenario:

say i have tables A and B (id, name, C_id), both have a foreign key reference to table C (A_or_B_id, foo)

in the interest of normalization, i'm consolidating A and B into a new table X. obviously i cannot preserve the key id from one of the tables, let it be table B, since they would overlap with those from A.

the problem is now how to update table C with the new id from X? as far as i can tell, the reference from B is broken, so i cannot use a join.

any ideas? i might just resort to writing a php script to do it.




-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
i like your sleeves...they're real big
 
What do you mean by saying the table A and table B id's overlap? Do you mean there are duplicates? How do you indicate in table C which table (A or B) the id refers to?
 
thanks for the reply -

it's ugly, handled internally by the app... i did just end up writing some php to do it


-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
i like your sleeves...they're real big
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top