+ -
当前位置:首页 → 问答吧 → 请各位帮助看下问题出在哪?

请各位帮助看下问题出在哪?

时间:2011-09-08

来源:互联网

create or replace function dhqd(re1 varchar2) return varchar2 is
xx1 varchar2(50);
i number(1);
begin
i:=1;

if re1 like '%'||'LLP'||'%' then
xx1:=substr(re1,1,7);

if re1 like 'SH1'||'%' then
xx1:=substr(re1,1,4);

else
for i in 1..12 loop
  if instr(substr(re1,1,i),'0',-1,1) > 0 or instr(substr(re1,1,i),'1',-1,1) > 0 or instr(substr(re1,1,i),'2',-1,1) > 0 or instr(substr(re1,1,i),'3',-1,1) > 0 or instr(substr(re1,1,i),'4',-1,1) > 0 or instr(substr(re1,1,i),'5',-1,1) > 0 or instr(substr(re1,1,i),'6',-1,1) > 0 or instr(substr(re1,1,i),'7',-1,1) > 0 or instr(substr(re1,1,i),'8',-1,1) > 0 or instr(substr(re1,1,i),'9',-1,1) > 0 then
  xx1:=substr(re1,1,i-1);
  exit;
  end if;  
end loop;
end if;
return(xx1);
  
end dhqd;


最后编译的时候提示:
编译错误

错误:PLS-00103: Encountered the symbol "DHQD" when expecting one of the following:
      
          if
行:23
文本:end dhqd;

作者: ljwily   发布时间: 2011-09-08

知道原因了elsif

作者: ljwily   发布时间: 2011-09-08

热门下载

更多