Question

I am trying to create a simple PL/SQL function but its returning error -> PLS-00103: Encountered the symbol "IS". I am not sure whats wrong here, so could anybody out there please help. I followed the following steps -

Step1 - Logged in as sysdba using - sqlplus / as sysdba

Step2 - Created a file name test.sql with following code under C:\ -

CREATE OR REPLACE FUNCTION employer_details_func
RETURN VARCHAR(20);
IS 
  emp_name VARCHAR(20); 
BEGIN 
SELECT first_name INTO emp_name
FROM emp_tbl WHERE empID = '100';
RETURN emp_name;
END;
/ 

Step3 - Ran the following commands -

SQL>@C:\test.sql
Warning: Function created with compilation errors.
SQL> show error function Func;
Errors for FUNCTION FUNC:
LINE/COL ERROR
5/1      PLS-00103: Encountered the symbol "IS"
SQL>

Don't know why am I getting this weird error. Any help is highly appreciated.

No correct solution

OTHER TIPS

Create your function as follows and try

CREATE OR REPLACE FUNCTION employer_details_func
    RETURN VARCHAR2
IS
    emp_name   VARCHAR2 (20);
BEGIN
    SELECT  first_name
      INTO  emp_name
      FROM  emp_tbl
     WHERE  empID = '100';

    RETURN emp_name;
END;
/
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top