我就是想在存储过程中写一个 不为空 同时不为NULL的语句!
都有什么好方法呢?
我看到一个帖子,说:
if nvl(strsql, '') <> '' then
end if
不过那人说这个要慎重使用(原因如下):
[php]
SQL> var a varchar2(10);
SQL> exec :a := '';
PL/SQL 过程已成功完成。
SQL> select case when nvl(:a, 'null') = 'null' then 'null' else 'not null' end from dual;
CASEWHEN
--------
null
SQL> select case when nvl(:a, 'null') <> 'null' then 'not null' else 'null' end from dual;
CASEWHEN
--------
null
SQL> select case when nvl(:a, '') <> '' then 'not null' else 'null' end from dual;
CASEWHEN
--------
null
SQL> select case when nvl(:a, '') = '' then 'null' else 'not null' end from dual;
CASEWHEN
--------
not null
SQL>[/php]