Home > Database > Mysql Tutorial > Oracle一则诡异的程序

Oracle一则诡异的程序

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 17:45:47
Original
919 people have browsed it

function chkA_B return varchar2 as

  a   varchar2(10):=NULL;

  b   varchar2(10):='1';

  begin

  if a=b then

  return 'Error';

  end if;

  return 'ok';

  end;

  这段程序诡异地返回ok,而不是Error. 通过跟踪,程序进入了 return 'error' .但是紧接着也执行了return 'ok'.

  如果将if 的条件改为 if nvl(a,'0')=b 则程序正常。

 

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Return value problem
From 1970-01-01 08:00:00
0
0
0
Return JSON response via PHP
From 1970-01-01 08:00:00
0
0
0
Usage of return
From 1970-01-01 08:00:00
0
0
0
Why not return data in json format?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template