user1684309
user1684309

Reputation: 13

PLS-00103: Encountered the symbol

i am trying to compile this function

CREATE OR REPLACE FUNCTION sql_error_msg (err_num PLS_INTEGER) 
RETURN VARCHAR2 IS 
BEGIN 
RETURN sqlerrm(-err_num); 
EXCEPTION 
WHEN OTHERS THEN 
RETURN NULL; 
END sql_error_msg
/

but i am getting this error:

FUNCTION SQL_ERROR_MSG
On line:  8
PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:

   ;
The symbol ";" was substituted for "end-of-file" to continue.

Upvotes: 1

Views: 7432

Answers (2)

jediz
jediz

Reputation: 4717

I was trying to execute PL/SQL that "creates or replaces" a function, using <jdbc:initialize-database> tag. I was given the PLS-00103 and it turned out PL/SQL is not currently supported this way.

You have to execute the script in a different way.

I am going to try directly with JDBC as per http://www.coderanch.com/t/298532/JDBC/databases/run-SQL-Script-file-JDBC and work out a solutiom from there.

Upvotes: 0

Nick Krasnov
Nick Krasnov

Reputation: 27251

Just add ; at the end of the function.

 END sql_error_msg;
/

Upvotes: 3

Related Questions