Friday, 16 May 2014

using case in plsql

DECLARE
grade char(1) := 'A';
BEGIN
 CASE
   grade
   when 'A' then dbms_output.put_line('Excellent');
   when 'B' then dbms_output.put_line('Very good');
   when 'C' then dbms_output.put_line('Well done');
   when 'D' then dbms_output.put_line('You passed');
   when 'E' then dbms_output.put_line('Better try again');
   else dbms_output.put_line('No such grade');
   END CASE;

END;

No comments:

Post a Comment

Note: only a member of this blog may post a comment.