具体代码如下:
declare
v varchar2(50) := '123' ;
k number(12) ;
begin
if v = '1' then
k := 1;
elsif v = '123' then
k := 2;
elsif instr(v,'12') > 0 then
k := 3;
end if;
end ;
存储过程中最后k值输出的值为 2,当进入v=’123’判断,不进行以后的判断。
具体代码如下:
declare
v varchar2(50) := '123' ;
k number(12) ;
begin
if v = '1' then
k := 1;
elsif v = '123' then
k := 2;
elsif instr(v,'12') > 0 then
k := 3;
end if;
end ;
存储过程中最后k值输出的值为 2,当进入v=’123’判断,不进行以后的判断。