Re: Batch Update question
I guess this is probably a question for Mike, but if anyone else can answer it please feel free.
I am trying to create a batch update, which will only be run from the Tools menu (not as a quick report), which will set the confidential flag for all occurrences of all taxa which have been given our local Taxon Designation "Confidential" (a designation we have assigned to all taxa which we regard as confidential under all circumstances).
I have the SQL necessary to do the update (almost), but am unsure about how to wrap it up as a batch update (has any help been written for this yet?)
The SQL is as follows
UPDATE TAXON_OCCURRENCE AS TOCC INNER JOIN
TAXON_DETERMINATION AS TDET ON
TOCC.TAXON_OCCURRENCE_KEY = TDET.TAXON_OCCURRENCE_KEY
INNER JOIN
TAXON_DESIGNATION AS TDES INNER JOIN
INDEX_TAXON_NAME AS ITN ON
TDES.TAXON_LIST_ITEM_KEY = ITN.TAXON_LIST_ITEM_KEY INNER JOIN
INDEX_TAXON_NAME AS ITN1 ON
ITN.RECOMMENDED_TAXON_LIST_ITEM_KEY =
ITN1.RECOMMENDED_TAXON_LIST_ITEM_KEY ON
TDET.TAXON_LIST_ITEM_KEY = ITN1.TAXON_LIST_ITEM_KEY
SET TOCC.CONFIDENTIAL = 1
TOCC.CHANGED_BY = (SELECT NAME_KEY FROM NAME WHERE
<Condition field="Name.Name_Key" type="CurrentUserID"
name="Current User ID" operator="equal" /> )
TOCC.CHANGED_DATE = GETDATE()
WHERE (TDES.TAXON_DESIGNATION_TYPE_KEY = 'DSS0062800000003')
I think the SQL is correct, but how do I make this into a batch update?
Thanks in anticipation
Wildlife Sites Officer
Wiltshire & Swindon Biological Records Centre