Easy learning with example program codes

Oracle pl sql switch case statement tutorial

PL/SQL Case Statement:

Switch statement is used to execute a block of statement based on the switch expression value. An expression must be of type int, short, byte or char. A case value should be a constant literal value and cannot be duplicated. Expression value is compared with each case value. If a match found corresponding block of statements will be executed. A break statement is used to terminate the execution of statements. If no case value matches with expression value then default block of statements will be executed. If break statement is not used within case, all matching cases will be executed.


CASE [expression]  
WHEN condition1 THEN Block of statements1  
   WHEN condition2 THEN Block of statements2
   WHEN conditionn THEN Block of statementsn
 ELSE Block of statements  


   nameChar char(1) := 'J';
   CASE nameChar
      when 'B' then dbms_output.put_line('Bharat');
      when 'R' then dbms_output.put_line('Richi');
      when 'S' then dbms_output.put_line('Sahdev');
      when 'V' then dbms_output.put_line('Vinod');
      when 'H' then dbms_output.put_line('Harish');
      when 'M' then dbms_output.put_line('Mahesh');
      when 'V' then dbms_output.put_line('Vivek');
      when 'A' then dbms_output.put_line('Anil');
      when 'J' then dbms_output.put_line('Jai');
      else dbms_output.put_line('No such name');



Industrial Training

We offers Placement Oriented Training on Java, Spring, JSF, Hibernate, PHP, AngularJS, Angular 4, PLSQL, Oracle BI Publisher etc. We also provides Online training, please mail us at


We also provides the Development services for Website Development , Java Development, PHP Development, Android App Development etc. You can contact us on

Copyright © 2019 CodesJava Protection Status SiteMap Reference: Java Wiki