Jeff Clenard Posted June 1 Report Share Posted June 1 I am looking for help with writing a SQL script that can be used to update an eventtype from one tag to another. Both types are for individuals, not families. (I am hopeful this is doable.) I imported several GEDCOM files into my primary TNG database a few months back after doing a lot of cleanup in them. I recently realized that I missed one tag in particular; that being a Residence (RESI) tag which should have been changed to one of several Census (EVEN) tags. I've made too many updates since the imports to go to a backup and start over. As a result, I have several thousand Residence (RESI) tags that I want to change to various Census (EVEN) tags based upon date. For example, I want to select all event records with a Residence (RESI) tag where the event Date contains "1850" and update the tag to a different eventtype (EVEN), in this example, "1850 U.S. Census." My goal is to update all Residence (RESI) tags that align with U.S. Census years 1850, 1860, 1870, etc. using variations of the script. The various U.S. Census tags for each decade are already created and in use. My tng_eventtypes table for the two records in the above example looks like the following: eventtypeID: 3 tag: RESI description: display: Residence type: I eventtypeID: 413 tag: EVEN description: 1850 U.S. Census display: 1850 U.S. Census type: I Quote Link to comment Share on other sites More sharing options...
Rob Severijns Posted June 2 Report Share Posted June 2 Jeff, Can't you do it via phpMyadmin and use the Find & Replace function? Quote Link to comment Share on other sites More sharing options...
Jeff Clenard Posted June 2 Author Report Share Posted June 2 Thanks for the pointer, Rob. I had not considered phpMyAdmin to do the work. I will give it a try after backing up my DB and follow up here should I have any questions. Quote Link to comment Share on other sites More sharing options...
Jeff Clenard Posted June 3 Author Report Share Posted June 3 Thanks again for the pointer, Rob. I was able to make all of the desired changes via phpMyAdmin. Quote Link to comment Share on other sites More sharing options...
Rob Severijns Posted June 3 Report Share Posted June 3 That's great Glad I could be of help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.