Hi All,
I have a procedure with a cursor that returns a list of users. Then for each of this users I check account status, and couple other things and send email with these details about each of users. If cursor returns 20 rows (users) my procedure generates 20 emails so the loop works for each row from cursor which is good but I want it to work little different. There is a field called contact_group which has email assigned. Each user is in one of these contact groups. I would like loop to run for each of contact_groups regardless of how many users are there in the group.
Long story short if cursor returns 20 users but they are assigned to 5 different groups I want procedure to send 5 emails only with 4 users in each.
Thanks!