/
How to reset PSPEC_UID sequences?
Got feedback or spotted a mistake?
Leave a comment at the end of this page or email contact@krishagni.com
How to reset PSPEC_UID sequences?
Please be sure to test below SQL on your test/dev instances before running on the prod database instance.
Oracle
merge into key_seq_generator d using ( select p.identifier as parent_id, count(c.identifier) as children from catissue_specimen p inner join catissue_specimen c on c.parent_specimen_id = p.identifier where c.label is not null group by p.identifier ) s on (d.key_type = 'PSPEC_UID' AND d.key_value = to_char(s.parent_id)) when matched then update set d.key_sequence_id = to_char(s.children) when not matched then insert (identifier, key_type, key_value, key_sequence_id) values (key_generator_seq.nextval, 'PSPEC_UID', to_char(s.parent_id), to_char(s.children))
Note: The above SQL doesn't work as expected when one or more child specimens in between the hierarchy are "hard" deleted.
, multiple selections available,
Related content
How to reset label sequences?
How to reset label sequences?
More like this
De-identification of OpenSpecimen data
De-identification of OpenSpecimen data
More like this
Update Collected Specimen To Correct Specimen Requirement.
Update Collected Specimen To Correct Specimen Requirement.
More like this
Bulk edit/delete participants via UI
Bulk edit/delete participants via UI
More like this
How to fix the global search results?
How to fix the global search results?
More like this
Specimens CSV
Specimens CSV
More like this
Got feedback or spotted a mistake?
Leave a comment at the end of this page or email contact@krishagni.com