存储过程值的比较

在oracle中进行 != , is not null , not in 的比较时,比较的值不能为空值。

declare 
v varchar2(50) := '' ;

begin
if  v  = '123' then
  v := '1';
end if;
end ;

当定义的变量v=”的时候,不进入判断语句;
当定义的变量v=’ ‘的时候,进入判断语句,最近v=’1’;
当v=”的处理如下:

declare 
v varchar2(50) := '' ;
begin
if nvl(v,'0') != '123' then
  v := '1';
end if;
if  v  = '123' then
  v := '2';
end if;
end ;

猜你喜欢

转载自blog.csdn.net/qq_28198893/article/details/82379274