Oracle 9i :ERROR :Function compilation error PLS-00103:

[color=Red][b]WHERE IS THE ERROR UNABLE TO SPOT IT[/b][/color]


[color=Red]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 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 and or
||
The symbol "then was inserted before "RETURN" to continue.

LINE/COL ERROR[/color]-------- -------------------------------------------------------------

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

Comments

  • 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;
    /
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion