标题:一个存储过程的编译错误,急呀..各位大虾帮忙呀?
只看楼主
yiranmuder
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2010-8-19
 问题点数:0 回复次数:1 
一个存储过程的编译错误,急呀..各位大虾帮忙呀?
CREATE OR REPLACE PROCEDURE test(inv_id in NUMBER,storehouse_id in NUMBER,tag in varchar2) AS
   BEGIN
   BEGIN
       IF tag='国家基本药品'
       then  
       DECLARE CURSOR cursorA IS select distinct(a.m_id) from store a,medicine b where a.storehouse_id=storehouse_id and  a.m_id= b.m_id and b.basic_tag='是' and b.special_tag_id='3';
       END IF;
       IF tag ='非国家基本药品'
       then  
       DECLARE CURSOR cursorA IS select distinct(a.m_id) from store a,medicine b where a.storehouse_id=storehouse_id and  a.m_id= b.m_id and b.basic_tag='否' and b.special_tag_id='3';
       END IF;
       IF tag='消耗材料'
       then  
       DECLARE CURSOR cursorA IS select distinct(a.m_id) from store a,medicine b where a.storehouse_id=storehouse_id and  a.m_id= b.m_id  and b.special_tag_id='21';
       END IF;
       IF tag='特殊药品'
       then  
       DECLARE CURSOR cursorA IS select distinct(a.m_id) from store a,medicine b where a.storehouse_id=storehouse_id and  a.m_id= b.m_id  and b.special_tag_id not in('3','21');
       END IF;     
     END;
     END;



错误提示: 第八行pls-001103出现'end'需要在下列情况之一......
搜索更多相关主题的帖子: 编译 
2010-08-19 18:41
yiranmuder
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2010-8-19
得分:0 
自己先顶一个

可否通过传入参数控制存储过程变量的定义呀?
有什么方法呀?
2010-08-20 08:27



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-316251-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.091958 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved