1

Topic: Batch Update on Individual

Hi All, I was wondering if anyone has a working batch update for R6 that will delete from the database any records from a particular Individual recorder.

Natural History & Biodiversity Data Enthusiast

2 (edited by RobLarge 27-01-2015 14:04:16)

Re: Batch Update on Individual

Should be easy enough to achieve with existing batch updates & a bit of SQL, assuming that you want to delete all records where that individual is a recorder (i.e. including any records where there are other additional recorders.

First (make a backup!) modify (inserting the individual's name key) the following SQL and run it either in the linked Access database or in management studio

UPDATE
((TAXON_OCCURRENCE INNER JOIN SAMPLE ON TAXON_OCCURRENCE.SAMPLE_KEY = SAMPLE.SAMPLE_KEY)
INNER JOIN SURVEY_EVENT ON SAMPLE.SURVEY_EVENT_KEY = SURVEY_EVENT.SURVEY_EVENT_KEY)
INNER JOIN SURVEY_EVENT_RECORDER ON SURVEY_EVENT.SURVEY_EVENT_KEY = SURVEY_EVENT_RECORDER.SURVEY_EVENT_KEY
SET TAXON_OCCURRENCE.COMMENT = "DELETETHISRECORD"
WHERE (((SURVEY_EVENT_RECORDER.NAME_KEY)="Individual's NAME_KEY"))

Then use the batch update Del2 to delete all records with DELETETHISRECORD in the comment field
Then if required also run Del4 & Del3 to remove any empty samples and events

That's how I would tackle it anyway, I can think of a few other ways too though.

Rob Large
Wildlife Sites Officer
Wiltshire & Swindon Biological Records Centre

3

Re: Batch Update on Individual

Excellent, cheers Rob

Natural History & Biodiversity Data Enthusiast