在下面的程序中,我做错了什么,我没有得到我错误的地方“遇到符号”结束“当期待以下之一”请帮助我解释与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;
提前致谢
答案 0 :(得分:2)
你需要在else和else之间使用一些代码。或者只是删除else:
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;
答案 1 :(得分:0)
PL / SQL不允许像其他语言一样使用空块。 One way to circumvent this is to put a NULL;
statement您没有任何其他声明:
IF outcount = 1 THEN
OPEN p_resultset FOR [...]
CLOSE p_resultset;
ELSE
NULL; -- The NULL statement
END IF;