Is it bad practice to execute this query in a for or foreach-loop?

Ahhh…ok. I am not the SQL expert, but maybe this will give you an idea on a direction?

SELECT c.id “ClientId”, c.name “ClientName”, d.name “DepartmentName”
FROM clients c, department_activity da, departments d
WHERE da.object_id = c.id AND da.department_id = d.id AND da.object_type = ‘client’;

Or something to that effect.

Scott