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

Home -> Community -> Usenet -> c.d.o.server -> Re: Programming Procedure

Re: Programming Procedure

From: James <james_lorenzen_at_allianzlife.com>
Date: Thu, 01 Apr 1999 22:21:30 GMT
Message-ID: <7e0rh1$vul$1@nnrp1.dejanews.com>


Stan, try

CREATE PROCEDURE AVGBALANCE (i_state CHAR(22)) <===== name change RETURNS (AVG_AMOUNT FLOAT)
AAS
BEGIN
  SELECT AVG(BALANCE_DUE) FROM CUSTOMER   WHERE STATE = i_state INTO AVG_AMOUNT; <===== name change   SUSPEND;
END; bind variables are not required in PL*SQL. I changed the name to avoid confusion (and interesting results) in the where clause.

HTH
   James

In article <3703E19A.50845BB1_at_yahoo.com>,   Delphi Dev <delphidev_at_yahoo.com> wrote:
>
> --------------711C4FD334AD3847756E42B7
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
>
> I have the following in an ascii file. I then go into SQL plus and do a
> File Open. Then I do a run. I get an Bind variable "STATE" not
> declared. Is this the proper way of programing procedures into the
> Server?
>
> Thanks, Stan
>
> SET TERM !!;
> CREATE PROCEDURE AVGBALANCE (STATE CHAR(22))
> RETURNS (AVG_AMOUNT FLOAT)
> AAS
> BEGIN
> SELECT AVG(BALANCE_DUE) FROM CUSTOMER
> WHERE STATE = :STATE INTO AVG_AMOUNT;
> SUSPEND;
> END; !!
> SET TERM; !!
>
> --------------711C4FD334AD3847756E42B7
> Content-Type: text/html; charset=us-ascii
> Content-Transfer-Encoding: 7bit
>
> <HTML>
> I have the following in an ascii file.&nbsp; I then go into SQL plus and
> do a File Open.&nbsp; Then I do a run.&nbsp; I get an&nbsp; <B>Bind variable
> "STATE" not declared.&nbsp; </B>Is this the proper way of programing
procedures
> into the Server?
>
> <P>Thanks, Stan
> <BR>&nbsp;
>
> <P>SET TERM !!;
> <BR>CREATE PROCEDURE AVGBALANCE (STATE CHAR(22))
> <BR>RETURNS (AVG_AMOUNT FLOAT)
> <BR>AAS
> <BR>BEGIN
> <BR>&nbsp; SELECT AVG(BALANCE_DUE) FROM CUSTOMER
> <BR>&nbsp; WHERE STATE = :STATE INTO AVG_AMOUNT;
> <BR>&nbsp; SUSPEND;
> <BR>END; !!
> <BR>SET TERM; !!
> <BR>&nbsp;</HTML>
>
> --------------711C4FD334AD3847756E42B7--
>
>

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Thu Apr 01 1999 - 16:21:30 CST

Original text of this message

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