Scripting group assignment in large database

Hi Max,

  1. The Comments sounds like a good place. This field is there to store notes or extra info about the Subject. Since this is rarely used, if you want to sort Subjects by their group, you would need to do as you are doing now. Retrieve all the protocol Subjects, and check their Comments field.

  2. Yes, use bst_set('ProtocolSubjects', s); after you the FOR loop

  3. You approach is a good way. Unfortunately, the Subject grouping will not be reflected on the DB explorer tree. If you want that, the only way would be to rename the Subjects to Group_SubjectName. To do so check db_rename_subject. Please note that this changes also the path in the HDD for the Subject files.

1 Like