Oracle PL/SQL - NULL Statement in ELSE Clause of Simple CASE Statement

Introduction

In the following code, the NULL statement shows that you have chosen to take no action for final_marks other than A, B, C, D, and F.

Demo

SQL>
SQL> CREATE OR REPLACE PROCEDURE print_final_mark (
  2    final_mark CHAR-- from ww w  . j ava2  s  .c  o m
  3  ) AUTHID DEFINER AS
  4  BEGIN
  5    CASE final_mark
  6      WHEN 'A' THEN DBMS_OUTPUT.PUT_LINE('Excellent');
  7      WHEN 'B' THEN DBMS_OUTPUT.PUT_LINE('Very Good');
  8      WHEN 'C' THEN DBMS_OUTPUT.PUT_LINE('Good');
  9      WHEN 'D' THEN DBMS_OUTPUT.PUT_LINE('Fair');
 10      WHEN 'F' THEN DBMS_OUTPUT.PUT_LINE('Poor');
 11      ELSE NULL;
 12    END CASE;
 13  END;
 14  /

Procedure created.

SQL>

Related Topic