Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: DECLARE inside Stored Procedure/Function?
On Tue, 28 Jul 1998 17:32:23 -0500, James Arvigo
<Hooper_X_at_Spam_Rage.com> wrote:
>I'm trying to create a stored function that makes use of
>some variables that need to be declared internally to the
>function.
>
>However, the "DECLARE" section of this code is being
>rejected,
>1 CREATE OR REPLACE FUNCTION radius.NewCallsFunc ()
>2 RETURN NUMBER IS
>3 rNumCalls NUMBER(10,0);
>4 DECLARE
>5 lNewCalls NUMBER(10,0);
>6 lOldCalls NUMBER(10,0);
>7 BEGIN
Get rid of the keyword DECLARE. It's not used with stored
functions. Local variables get declared immediately
following the CREATE command. For example, the variable
rNumCalls is a local variable to your function.
Jonathan Received on Tue Jul 28 1998 - 22:00:51 CDT