嗨,我是这里的新手,也是oracle pl/SQL块的新手,这是编译它返回的代码 警告:已编译但存在编译错误
create or replace function func_o12 return varchar2
is
declare nn varchar2(20);
begin
select
case substr(1234,1,3)
when '134' then '1234 is a match'
when '1235' then '1235 is a match'
when concat('1','23') then concat('1','23')||' is a match'
else 'no match'
end
into :nn
from dual;
return :nn;
end;
您不需要声明或绑定标记:
create or replace function func_o12 return varchar2
is
nn varchar2(20);
begin
select
case substr(1234,1,3)
when '134' then '1234 is a match'
when '1235' then '1235 is a match'
when concat('1','23') then concat('1','23')||' is a match'
else 'no match'
end
into nn
from dual;
return nn;
end;