When I try the following:
declare var_type VARCHAR2(10);
begin
var_type := 'B';
select case var_type
when 'B' then 'Beans'
when 'L' then 'Legumes'
end
from tableOfBeans ;
end;
I get an error saying
ORA-06550: line 4, column 1:
PLS-00428: an INTO clause is expected in this SELECT statement
Error detected at position #:62
But when I don't use var_type
but instead use 'B' as the condition it works nicely. Can anyone tell me why this happens and how do I fix it so I can use var_type
properly?