Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Am getting error PLS-00103, when i tried to use 'case'

605074Oct 24 2007 — edited Oct 24 2007
Always 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>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 21 2007
Added on Oct 24 2007
3 comments
263 views