Character is Vowel or Consonants

00:40 0 Comments A+ a-

Write a PLSQL block to check whether a given character is vowel or consonants.


Program:



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: x
old   5: choice:='&choice';
new   5: choice:='x';

xis consonant