开发者

populate pl/SQLvariable

开发者 https://www.devze.com 2023-02-02 04:45 出处:网络
I have the following if hero.name != lastManStanding then dbms_output.put(hero.name); lastManStanding := hero.name;

I have the following

if hero.name != lastManStanding then
    dbms_output.put(hero.name);
    lastManStanding := hero.name;
end if;

where

开发者_如何转开发
lastManStanding hero.name%type;

However the if block never gets execute. What am I doing wrong?


If lastManStanding is null, the condition will never evaluate to true. Such is the case with NULL.

Change it to:

if hero.name != nvl(lastManStanding, 'xxxxxx') then
0

精彩评论

暂无评论...
验证码 换一张
取 消