1

在下面的过程中,我做错了,我没有得到错误的地方,当期待以下之一时“遇到符号”结束“请帮助我并用 wat 解释程序中的错误。

create or replace PROCEDURE CRangeproc(in_termid IN VARCHAR2,in_cardno IN VARCHAR2,p_ResultSet OUT SYS_REFCURSOR,outcount OUT NUMBER)
AS 
BEGIN 
select count(*) into outcount from cardrangetable where PAN_LOW <= in_cardno AND  PAN_HIGH >=   in_cardno and terminal_id = in_termid;
IF outCount = 1 then
Open p_ResultSet FOR    
select ISSUERTABLEID,ACQUIRERTABLEID,PANLENGTH from cardrangetable where PAN_LOW <= in_cardno  AND  PAN_HIGH >= in_cardno and terminal_id = intermid;
CLOSE p_ResultSet;
else
end if; 
End CRangeproc;

提前致谢

4

2 回答 2

2

在 else 和 end if 之间需要一些代码。或者只是删除其他:

begin
   select count(*)
     into outcount
     from cardrangetable
    where pan_low <= in_cardno
      and pan_high >= in_cardno
      and terminal_id = intermid;
   if outcount = 1
   then
      open p_resultset for
         select issuertableid
               ,acquirertableid
               ,panlength
           from cardrangetable
          where pan_low <= in_cardno
            and pan_high >= in_cardno
            and terminal_id = intermid;
      exit when p_resultset%notfound;
      close p_resultset;
   else
      -- You need some code here or remove the else.
   end if;
end crangeproc;
于 2012-11-01T07:40:29.387 回答
0

PL/SQL 不允许像其他语言那样使用空块。避免这种情况的一种方法是NULL;在没有任何其他声明的地方放置一个声明

IF outcount = 1 THEN
  OPEN p_resultset FOR [...]

  CLOSE p_resultset;
ELSE
  NULL; -- The NULL statement
END IF; 
于 2015-04-13T12:23:58.707 回答