我有一个需要从架构中删除的用户列表。我创建了表OWNERS_TO_REMOVE,其中包含需要删除的用户的名称。我尝试创建以下光标以删除用户,但它不起作用。是否需要进行微调或是否需要以完全不同的方式删除用户?
DECLARE
CURSOR c_remove_owners IS
SELECT OWNER FROM OWNERS_TO_REMOVE;
v_owner OWNERS_TO_REMOVE.OWNER%TYPE;
BEGIN
OPEN c_remove_owners;
LOOP
FETCH c_remove_owners INTO v_owner;
EXIT WHEN c_remove_owners%NOTFOUND;
DROP USER v_owner CASCADE;
END LOOP;
CLOSE c_remove_owners;
END;
/