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!

Creating Function Inside Package Error(15,3): PLS-00103: Encountered the symbol ";" when expecting o

3149976Jan 15 2016 — edited Jan 15 2016

Hi

I am trying to create a function inside the package.

In The Package BODY I have defined the function, but in the package definition, it is giving me syntax errors.

  • Error(15,3): PLS-00103: Encountered the symbol ";" when expecting one of the following: return 
  • Error(39,1): PLS-00103: Encountered the symbol "END" when expecting one of the following: begin function pragma procedure subtype type    current cursor delete exists prior 

What I may be doing wrong here.

Thanks,

Ken

Inside Package BODY :

  /*FUNCTION to Form the Query*/

FUNCTION UDF_FORMQUERY(

    IN_CASEID    VARCHAR2,

    IN_SRCLYR    VARCHAR2,

    IN_SRC_CONDN VARCHAR2

   )

  RETURN VARCHAR2

AS

  varSQLQuery VARCHAR2(10000);

BEGIN

  varSQLQuery:= 'test Query' ;

  RETURN varSQLQuery;

  DBMS_OUTPUT.PUT_LINE(varSQLQuery);

END UDF_FORMQUERY;

Inside Package Definition :

create or replace PACKAGE BODY MY_SQUERY

AS

FUNCTION UDF_FORMQUERY(

    IN_CASEID    VARCHAR2,

    IN_SRCLYR    VARCHAR2,

    IN_SRC_CONDN VARCHAR2)

    RETURN VARCHAR2

   AS  varSQLQuery VARCHAR2(10000);  

END MY_SQUERY;

This post has been answered by Nimish Garg on Jan 15 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 12 2016
Added on Jan 15 2016
3 comments
768 views