Re: Question? How to Execute an SP through SQLPlus that Returns an Out Value

From: Ray Vonhollen <RVONHOLLEN_at_pacbell.net>
Date: Fri, 06 Apr 2001 09:53:15 -0700
Message-ID: <3ACDF47B.F1D473D7_at_pacbell.net>


Sybrand, thats for your help. I have also disabled any HTML messaging in my browser. Had no idea it was on.

R-

Sybrand Bakker wrote:
>
> "Ray Vonhollen" <RVONHOLLEN_at_pacbell.net> wrote in message
> news:3ACD2488.7B1CFB4B_at_pacbell.net...
> I have a procedure as follows, and want to know how to execute it through
> SQL*PLus to return my OUT Value.
> I've tried all sort of syntactical representations to no avail!
> EXEC SP_HIGHTESTVAL(6700,119,10,0);
> I keep getting errors: PLS-00363: expression '0' cannot be used as an
> assignment target.
> Any help or reference materials available on this would be greatly
> appreciated.
> R -
> CREATE OR REPLACE PROCEDURE SP_HIGHESTVAL
> (M_ID IN NUMBER,
> F_ID IN NUMBER,
> F_E IN NUMBER,
> NEW_VAL OUT NUMBER)
> AS
> BEGIN
> NEW_VAL := 0;
> IF F_E = 10 Then
> SELECT (MAX(M.VAL)+1) INTO NEW_VAL
> FROM MYFILE M
> WHERE ((M.ID= M_ID) AND
> (M.FID = F_E));
> END IF;
> IF F_E = 20 Then
> SELECT (MAX(O.VAL)+1)
> FROM OTHERF O
> WHERE ((O.ID = M_ID) AND
> (O.FID = F_E));
> END IF;
> END;
>
> By design in *any* programming language, the actual parameter to a formal
> out parameter needs to be a *variable* instead of a *hardcoded literal* (in
> your case 0)
>
> Could also avoid posting in HTML. Many newsreaders can't read it.
>
> Hth,
>
> Sybrand Bakker, Oracle DBA
Received on Fri Apr 06 2001 - 18:53:15 CEST

Original text of this message