请各位帮助看下问题出在哪?
时间: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;
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
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28