I am trying to write a script for my Oracle 12C database which would allow me to DROP all users of a certain role but can't seem to get it right.
declare
cursor ID_CURSOR is
SELECT USERNAME
from all_users;
WHERE granted_role = 'STUDENT'
begin
for REC in ID_CURSOR loop
'DROP USER REC CASCADE';
end loop;
end;
/