How to get a list of empty groups in eHealth using a SQL query

Document ID : KB000031086
Last Modified Date : 14/02/2018
Show Technical Document Details

PROBLEM:

How do you get a list of empty groups on an eHealth server?

SOLUTION:

1. Start sqlpus

Linux/Solaris:

sqlplus $NH_USER/$NH_USER@$NH_DB_CONNECT_STRING

Windows:

sqlplus %NH_USER%/%NH_USER%@%NH_DB_CONNECT_STRING%

2. Run the following query

SELECT name, group_id,machine_id
FROM nh_group
WHERE group_id > 1000000 AND concat(group_id,machine_id) NOT IN (SELECT concat(group_id,group_machine_id) FROM nh_group_members);

NAME                 GROUP_ID               MACHINE_ID
----------------------------------------------------------------
Toast                   1000101                     0