SQL> declare
2 val varchar2(100);
3 city varchar2(20) := 'TORONTO';
4 begin
5 val := CASE city
6 WHEN 'TORONTO' then 'RAPTORS'
7 WHEN 'LOS ANGELES' then 'LAKERS'
8 WHEN 'BOSTON' then 'CELTICS'
9 WHEN 'CHICAGO' then 'BULLS'
10 ELSE 'NO TEAM'
11 END;
12
13 dbms_output.put_line(val);
14 end;
15 /
RAPTORS
PL/SQL procedure successfully completed.
|