首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

简单存储过程有关问题

2012-01-09 
简单存储过程问题asv_countnumberBEGINselectcount(td)fromoper_sortintov_countifv_count 0theninsert

简单存储过程问题
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;

热点排行