一个存储过程的编译错误,急呀..各位大虾帮忙呀?
CREATE OR REPLACE PROCEDURE test(inv_id in NUMBER,storehouse_id in NUMBER,tag in varchar2) ASBEGIN
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'需要在下列情况之一......