Generally, you will not find data in an odba-database with an ad-hoc sql-query, since it is all encoded with base64 (which was the easiest way to store marshalled ruby objects without breaking sql).
The email in ydim is indeed not the address that is being used in the swissmedic-updater. Instead, it's an instance variable in the company object.
Look at SwissmedicPlugin#mail_notifications. There you have:
if(... (email = cmp.swissmedic_email))
To see all companies that have a swissmedic-email configured, you can use this command in the oddb admin-tool:
ch.oddb> companies.values.select do |comp| comp.swissmedic_email end
This will probably simply output 'Array', since in the admin-tool, very long results are reduced with .class.to_s
But you can get various informations about it:
How many Companies have a swissmedic_email configured:
ch.oddb> companies.values.select do |comp| comp.swissmedic_email end.size
What emails are being used:
ch.oddb> companies.values.collect do |comp| comp.swissmedic_email end.compact.inspect
and so on.
Use the yus_add_user tool (in git/yus/bin)
$> yus_add_user firstname.lastname@example.org login ch.oddb.RootUser
> I used a Ruby script (Digest::SHA256 class) instead of gpg command to create > SHA256 hash value, then yus_add_user command worked!!