set serveroutput on begin for c in (SELECT username FROM dba_users where username like 'FDC%') loop begin dbms_output.put_line(c.username); execute immediate 'drop user ' || c.username || ' cascade'; end; end loop; end; /