DECLARE
cursor c1 is
--user_temp是記錄要停用帳號的表格,只有一個文字欄位a
select a from user_temp
r1 c1%rowtype
BEGIN
for r1 in c1 loop
fnd_user_pkg.updateuser
( x_user_name => r1.a,
x_owner => NULL, --必要的參數
x_end_date => sysdate,
);
end loop;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END;