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

有哪些存储过程语法错误?

2014-01-28 
有哪些存储过程语法错误?v_count number(10) v_area varchar(6) v_channel varchar(6) v_total number(1

有哪些存储过程语法错误?

v_count number(10);
v_area varchar(6);
v_channel varchar(6);
v_total number(10);
v_datecount number(10);
CURSOR cur0 IS select CommissaryId,count(*) as MemberCount from t_s_memberInfo
where TO_DATE(CreateDate, 'YYYY-MM-DD ')=TO_DATE(sysdate, 'YYYY-MM-DD ')
group by CommissaryId order by MemberCount desc
BEGIN
v_count=0;
FOR s IN cur0 LOOP
BEGIN
v_count=v_count+1;
v_total=0;
select area into v_area from t_o_paragraphDecompound
where t_o_paragraphDecompound.commissary=s.CommissaryId ;
select channel into v_channel from t_o_paragraphDecompound
where t_o_paragraphDecompound.commissary=s.CommissaryId ;
select total into v_total from t_o_dateTop order by ri desc;
v_total=v_total+s.MemberCount;
insert t_o_dateTop(ri,area,channel,commissary,amount,total,classTop)
values(sysdate,v_area,v_channel,s.CommissaryId , s.MemberCount,v_total,v_count)
END;
END LOOP;
END;


------解决方法--------------------------------------------------------
加上
create or replace procedure test
as
编译没有语法错误
如果执行错误,那可能是表和字段写的有问题,检查下
------解决方法--------------------------------------------------------
可以阿!
select area, channel into v_area,v_channel         

热点排行