当前位置:数据库 > Oracle >>

oracle空串比较

oracle空串比较
 
declare 
  len_x integer; 
  len_y integer; 

begin 

  select nvl(length(trim('')), 0) into len_x from dual; 

  select nvl(length(trim(null)), 0) into len_y from dual; 
  
  dbms_output.put_line('len_x=' || len_x); 
  dbms_output.put_line('len_y=' || len_x); 

  if len_x = len_y then 
    dbms_output.put_line('1111'); 
  else 
    dbms_output.put_line('2222'); 
  end if; 
end; 

 


CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,