Update U.S.A to USA in TNG Place names

From TNG_Wiki
Jump to navigation Jump to search

The following MySQL Update can be used to change "U.S.A" to "USA" in TNG Place names

Backup your TNG database tables first!

Use the following SQL Update at your own risk!

UPDATE tng_families SET marrplace = REPLACE(marrplace,' U.S.A.',' USA');
UPDATE tng_families SET divplace = REPLACE(divplace,' U.S.A.',' USA');
UPDATE tng_people SET birthplace = REPLACE(birthplace,' U.S.A.',' USA');
UPDATE tng_people SET altbirthplace = REPLACE(altbirthplace,' U.S.A.',' USA');
UPDATE tng_people SET deathplace = REPLACE(deathplace,' U.S.A.',' USA');
UPDATE tng_people SET burialplace = REPLACE(burialplace,' U.S.A.',' USA');
UPDATE tng_events SET eventplace = REPLACE(eventplace,' U.S.A.',' USA');
UPDATE tng_places SET place = REPLACE(place,' U.S.A.',' USA');

The following is an example of the results

UPDATE tng_families SET marrplace = REPLACE( marrplace, ' U.S.A.', ' USA' ) ;# Affected rows: 1748
UPDATE tng_families SET divplace = REPLACE( divplace, ' U.S.A.', ' USA' ) ;# Affected rows: 1
UPDATE tng_people SET birthplace = REPLACE( birthplace, ' U.S.A.', ' USA' ) ;# Affected rows: 4174
UPDATE tng_people SET altbirthplace = REPLACE( altbirthplace, ' U.S.A.', ' USA' ) ;# Affected rows: 646
UPDATE tng_people SET deathplace = REPLACE( deathplace, ' U.S.A.', ' USA' ) ;# Affected rows: 1832
UPDATE tng_people SET burialplace = REPLACE( burialplace, ' U.S.A.', ' USA' ) ;# Affected rows: 838
UPDATE tng_events SET eventplace = REPLACE( eventplace, ' U.S.A.', ' USA' ) ;# Affected rows: 280
UPDATE tng_places SET place = REPLACE( place, ' U.S.A.', ' USA' ) ;# Affected rows: 1264

Note that the above SQL Update will only work if you do not have the same place names with USA. If you do the query will result in duplicate keys error.

Note also that if you have places associated with Cemeteries, that the following query is also needed

UPDATE tng_cemeteries SET place = REPLACE(place,' U.S.A.',' USA');