Am getting error PLS-00103, when i tried to use 'case'
605074Oct 24 2007 — edited Oct 24 2007Always am getting the following error when i tried to use 'case'. Plese suggest me case usage
DECLARE
n number;
BEGIN
CASE n
WHEN 1 THEN dbms_output.put_line('n = 1');
WHEN 2 THEN
dbms_output.put_line('n = 2');
dbms_output.put_line('That implies n > 1');
ELSE dbms_output.put_line('n is some other value.');
END CASE;
END;
Error at line 1
ORA-06550: line 4, column 3:
PLS-00103: Encountered the symbol "CASE" when expecting one of the following:
begin declare exit for goto if loop mod null pragma raise
return select update while <an identifier>
<a double-quoted delimited-identifier> <a bind variable> <<
close current delete fetch lock insert open rollback
savepoint set sql execute commit forall
<a single-quoted SQL string>