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

简单存储过程问题
as
    v_count   number;
BEGIN
select   count(td)   from   oper_sort   into   v_count;
if   v_count> 0   then
    insert   into   test.alert(count,DATEDD)   values(v_count,sysdate);
end   if;
END   count;

第四行那错了,不能直接把这个统计值插入v_count吗?或者要用其他什么方法了实现这个

------解决方案--------------------
这样写
select count(td) into v_count from oper_sort ;
------解决方案--------------------
as
v_count number;
BEGIN
select count(td) into v_count from oper_sort;
if v_count> 0 then
insert into test.alert(count,DATEDD) values(v_count,sysdate);
end if;
END count;