Write a PL/SQL program to find whether given character is vowel or not using CASE statement.

Case statement in PL/SQL constitutes a sequence of statements and conditions, the statement whose condition is valid is executed.

In this post, we're going to see the solution of query - Write a PL/SQL program to find whether given character is vowel or not using CASE statement.

PLSQL



Actually the solution is pretty simple and if you have any query regarding the solution, please feel free to ask.

Solution- 
declare 
choice char(1); 
message char(100); 
begin 
choice:='&choice'; 
message:= 
case choice when 'a' then ' is vowel' 
when 'e' then ' is vowel' 
when 'i' then ' is vowel' 
when 'o' then ' is vowel' 
when 'u' then ' is vowel' 
else ' is consonant' 
end; 
dbms_output.put_line(choice||message); 
end; 
/

Output-
Enter value for choice: a 
old   5: choice:='&choice'; 
new   5: choice:='a'; 

a is vowel

This comment is open to all however, use of abusive language is not allowed. Please be respectful to others and share your views with a positive intent.

Post a Comment (0)
Previous Post Next Post