select ts2_clients.s_client_name as s_client_name,
       ts2_channel_privileges.i_cp_client_id as i_cp_client_id,
       ts2_channel_privileges.b_cp_flag_admin as b_cp_flag_admin,
       ts2_channel_privileges.b_cp_flag_autoop as b_cp_flag_autoop,
       ts2_channel_privileges.b_cp_flag_autovoice as b_cp_flag_autovoice
from ts2_channel_privileges,
     ts2_clients
where ts2_channel_privileges.i_cp_server_id = :iServerID
and ts2_channel_privileges.i_cp_channel_id = :iChannelID
and ts2_clients.i_client_server_id = :iServerID
and ts2_clients.i_client_id = ts2_channel_privileges.i_cp_client_id
