【发布时间】:2014-02-14 01:09:17
【问题描述】:
您好,我是这里的新手,也是 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;
【问题讨论】:
-
在这种情况下您不需要使用查询 - 只需直接分配
nn,例如nn := case ... end;