SQL>
SQL> DECLARE
2 v_Test1 NUMBER := 2;
3 v_Test2 VARCHAR2(20) := 'Goodbye';
4 BEGIN
5 CASE
6 WHEN v_Test1 = 1 THEN
7 DBMS_OUTPUT.PUT_LINE('One!');
8 DBMS_OUTPUT.PUT_LINE('Another one!');
9 WHEN v_Test1 > 1 THEN
10 DBMS_OUTPUT.PUT_LINE('> 1!');
11 DBMS_OUTPUT.PUT_LINE('Still > 1!');
12 WHEN v_Test2 = 'Goodbye' THEN
13 DBMS_OUTPUT.PUT_LINE('Goodbye!');
14 DBMS_OUTPUT.PUT_LINE('Adios!');
15 ELSE
16 DBMS_OUTPUT.PUT_LINE('No match');
17 END CASE;
18 END;
19 /
> 1!
Still > 1!
PL/SQL procedure successfully completed.
SQL>
SQL>
|