Iterating over wikis

Problem
Perform the same given query (e. g. ) over the set of wikis received from another query from   database (e. g. list of all Wikipedias or list of all wikis in   language etc.). The wikis of course do not have to be on the same SQL server.