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

oracle job
需要写个job每天检查一下coums这个表里的publish_date减去当前日期是否大于7.是的话就把另一个字段top设0

------解决方案--------------------
create or replace procedure pro01 is
diff number;
begin

select to_date(col1, 'yyyy-mm-dd') - SYSDATE
into diff
from a02
where rownum = 1;

if diff > 7 then
update a02 set col2 = '0';
end if;

end pro01;

然后建立个job,调用