Oracle

Moderators: None (Apply to moderate this forum)
Number of threads: 348
Number of posts: 673

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Oracle 9i :ERROR :Function compilation error PLS-00103: Posted by sagittarian_18 on 13 Jun 2009 at 1:00 AM
WHERE IS THE ERROR UNABLE TO SPOT IT


Errors for FUNCTION EMPTYPE:

LINE/COL ERROR
-------- -----------------------------------------------------------------
7/5 PLS-00103: Encountered the symbol "RETURN" when expecting one of
the following:
. ( * @ % & - + / at mod rem then <an exponent (**)> and or
||
The symbol "then was inserted before "RETURN" to continue.

9/5 PLS-00103: Encountered the symbol "RETURN" when expecting one of
the following:
. ( * @ % & - + / at mod rem then <an exponent (**)> and or
||
The symbol "then was inserted before "RETURN" to continue.

LINE/COL ERROR
-------- -------------------------------------------------------------

CREATE OR REPLACE FUNCTION emptype(paytype char)
RETURN Varchar2 IS
BEGIN
if paytype ='h' then
return 'hourly';
elsif paytype ='s'
return 'salaried';
elsif paytype ='e'
return 'executive';
else
return 'invalid type';
end if;

EXCEPTION
WHEN OTHERS THEN
RETURN 'Error encountred';
END emptype;
/

please reply
Report
Re: Oracle 9i :ERROR :Function compilation error PLS-00103: Posted by sagittarian_18 on 13 Jun 2009 at 1:15 AM
CREATE OR REPLACE FUNCTION em
RETURN Varchar2 IS
BEGIN
if paytype ='h' then
return 'hourly';
elsif paytype ='s' then ----YOU HAVE NOT ADDED
'THEN' here
return 'salaried';
elsif paytype ='e' then --- same as above
return 'executive';
else
return 'invalid type';
end if;

EXCEPTION
WHEN OTHERS THEN
RETURN 'Error encountred';
END emptype;
/



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.