oracle块中变量判断是否为空

oracle块中变量判断是否为空

1) 如果变量a = ''空串,则if判断时a = '' 及 a != ''都为false

-----------------------------------------------------------------------------------

oracle块中变量判断是否为空

oracle块中变量判断是否为空

2) 如果变量a = ''空串,则if判断时a is null 为true 及 a is not null为false

--------------------------------------------------------------------------------------------

oracle块中变量判断是否为空

oracle块中变量判断是否为空

oracle块中变量判断是否为空

3)如果a = '1'不为空串,if判断时a = '1'为true,a != '1'及a <> '1'为false

由此可见,当变量为空串 '' 时,等同null,需要用is null/is not null来判断,用= / !=判断不出来

<>等同!=

 

相关文章:

  • 2021-11-30
  • 2022-12-23
  • 2022-02-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-17
  • 2021-11-28
  • 2021-10-09
  • 2022-12-23
  • 2022-12-23
  • 2021-11-27
  • 2022-01-21
相关资源
相似解决方案