Hard to Get

--人生在世 难得二字

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::

PL/SQL Best Practices [14][If Statements]-IFs and Booleans

Avoid IF With Booleans
Sometimes you will code or come across conditional statements which, while valid, are unnecessary and cumbersome. Replace this IF statement:

IF hiredate < SYSDATE
THEN
   date_in_past :
= TRUE;
ELSE
   date_in_past :
= FALSE;
END IF;

With this:

date_in_past := 
   hiredate 
< SYSDATE;

You can assign a Boolean expression directly to a Boolean variable.

posted on 2005-09-13 21:43  Del  阅读(122)  评论(0)    收藏  举报