日期:2014-05-17  浏览次数:20787 次

请教在sql中,怎样在删除或更新记录前,统计出影响记录数量?
请教在sql中,怎样在删除或更新记录前,统计出影响记录数量?

------解决方案--------------------
在sql中? 你做删除或者更新应该有条件吧 ?根据条件select count(1) from ..就是可以得出数目
------解决方案--------------------
[code=SQL][/code]
create or replace trigger del_update_xxx
before delete or update on xxx
declare
v_count number;
begin 
select count(*) from xxx where 条件
dbms_output.put_line('影响记录数:'||v_count);
end;