Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: functions in a package

Re: functions in a package

From: DA Morgan <damorgan_at_exesolutions.com>
Date: Wed, 12 Feb 2003 21:09:18 -0800
Message-ID: <3E4B287E.B25BBC55@exesolutions.com>


Dwayne wrote:

> I am having trouble putting a function in a package body
> the problem now lies in putting the function in the package body. I
> keep getting syntax errors.
>
> let me show you:
>
> CREATE OR REPLACE PACKAGE CAP
> IS
> FUNCTION LAST_CAP RETURN VARCHAR2;
> END;
> /
>
> Package created.
>
> 1 CREATE OR REPLACE PACKAGE BODY CAP
> 2 IS
> 3 FUNCTION LAST_CAP
> 4 (NAME VARCHAR2)
> 5 RETURN VARCHAR2
> 6 IS
> 7 BEGIN
> 8 RETURN LOWER(SUBSTR(NAME,1,LENGTH(NAME)-1))||UPPER(SUBSTR(NAME,-1));
> 9 END LAST_CAP;
> 10* end;
> SQL> /
>
> Warning: Package Body created with compilation errors.
>
> SQL> show error
> Errors for PACKAGE BODY CAP:
>
> LINE/COL ERROR
> -------- -----------------------------------------------------------------
> 3/10 PLS-00323: subprogram or cursor 'LAST_CAP' is declared in a
> package specification and must be defined in the package body
>
> I spent 3 hours on this trying different combos but nothing.

Don't cross-post. The answer is in the other newsgroup.

Daniel Morgan Received on Wed Feb 12 2003 - 23:09:18 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US