2012-11-01 28 views
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; 

在此先感謝

回答

2

你需要別人和結束時,如果之間的一些代碼。或者刪除其他的:

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; 
+0

確定三江源,仍然有像 – 1001

+0

我發現IM使用in_termid的intermid而不是「忽略SQL語句」一些錯誤 – 1001

相關問題