![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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; / |
#3
| |||
| |||
|
|
"The Magnet" <a... (AT) unsu (DOT) com> a écrit dans le message de news: 485f556b-55c7-4cd3-a36a-9e0e6eadd... (AT) m11g2000vbl (DOT) 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 |
#4
| |||
| |||
|
|
"The Magnet" <a... (AT) unsu (DOT) com> a écrit dans le message de news: 485f556b-55c7-4cd3-a36a-9e0e6eadd... (AT) m11g2000vbl (DOT) 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 |
![]() |
| Thread Tools | |
| Display Modes | |
| |