情况一:
select (case when trim(' ') is not null then 'not null' else 'is null' end) as age from dual;
输出结果:age: 'is null'
情况二:删除trim()
select (case when ' ' is not null then 'is null' else 'not null' end) as age from dual;
输出结果:age: 'not null'
由以上测试可以得出今后的判断条件为:
if (trim(nvl(var_name_str,''))='') then
begin
your operation;
end;
end if;
nvl用法:nvl(arg,value)代表如果前面的arg的值为null那么返回的值为后面的value
select (case when trim(' ') is not null then 'not null' else 'is null' end) as age from dual;
输出结果:age: 'is null'
情况二:删除trim()
select (case when ' ' is not null then 'is null' else 'not null' end) as age from dual;
输出结果:age: 'not null'
由以上测试可以得出今后的判断条件为:
if (trim(nvl(var_name_str,''))='') then
begin
your operation;
end;
end if;
nvl用法:nvl(arg,value)代表如果前面的arg的值为null那么返回的值为后面的value