Re: CASE

From: Michel Cadot <micadot{at}altern{dot}org>
Date: Thu, 17 Sep 2009 19:55:34 +0200
Message-ID: <4ab27819$0$429$426a74cc_at_news.free.fr>


"The Magnet" <art_at_unsu.com> a écrit dans le message de news: 485f556b-55c7-4cd3-a36a-9e0e6eadd0b9_at_m11g2000vbl.googlegroups.com...
|
| This is actually proving harder to find than I originally thought. In
| PLSDQL, can't I have some CASE statement like this. I want to use an
| OR in the WHEN clause......
|
|
| DECLARE
| x number := 1;
|
| BEGIN
| CASE x
| WHEN 1 OR 2 OR 3 THEN
| DBMS_OUTPUT.PUT_LINE('YES');
| ELSE
| DBMS_OUTPUT.PUT_LINE('NO');
| END CASE;
| END;
| /

SQL> DECLARE
  2 x number := 1;
  3
  4 BEGIN
  5 CASE

  6     when x=1 or x=2 or x=3 THEN
  7        DBMS_OUTPUT.PUT_LINE('YES');
  8      ELSE
  9        DBMS_OUTPUT.PUT_LINE('NO');

 10 END CASE;
 11 END;
 12 /
YES PL/SQL procedure successfully completed.

Regards
Michel Received on Thu Sep 17 2009 - 12:55:34 CDT

Original text of this message