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 ;
