您好,欢迎访问一九零五行业门户网

Oracle 判断字符串为''还是Null

oracle 判断varchar2类型是不是为空
oracle 判断varchar2类型是不是为空'' ,用什么判断符
vv_list:='dsssfdfdsfds';
if(vv_list '')then
  dbms_output.put_line('ppppppppppppppppp');
  else
  dbms_output.put_line('bbbbbbbbbbbbbbbbbbbbbbbb');
  end if;
结果却打印了bbbbbbbbbbbbbbbbbbbbbbbb
if ('' is null) then
  dbms_output.put_line(''''' is null');
  end if;
输出:'' is null
这说明,在oracle pl/sql里,,把''当成null处理了
oracle中的空应该用的是null,非空就是not null
for example:
sql code
sql code 所以可以这么做:
select
st.koyu_zaisan_no
,st.koyu_zaisan_edaban
,st.shutoku_nendo  --?異動年度
,st.shutokubi          --?異動日
,st.kaikei
,'会計名'                 --?
,st.shukanka          --?
,'kanjyo_kamoku_meisho'  --?
,'金額'
,'err_no'                 --?
,'err_naiyo'            --?
,'0' csv_type          --?
from shisan_tab st
where  trim(nvl(st.chiku_cd,'')) || 'a' ='a'
or  trim(nvl(st.chimoku,'')) || 'b' ='b'
其它类似信息

推荐信息