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: [ask]: what wrong with my store procedure

Re: [ask]: what wrong with my store procedure

From: Geoff White <whiteg_at_ccis.adisys.com.au>
Date: Thu, 18 Mar 1999 10:12:45 +0800
Message-ID: <36F0611D.D1DCF32E@ccis.adisys.com.au>


earthlink wrote:

> hi, everyone,
> i'm new in Oracle programming.
> i just create some stored procedures.
> some procedures work, some don't.
> can you help me why this storee procedure won't work?
>
> p.s. I got compilation error from oracle.
> TIA
>
> Phil
>
> create or replace procedure t1
> is
> begin
> select count(*)
> from t_customer
> where person = 'father';
> end;
> /

You must select into something. A select statement such as you have here is not valid in PL/SQL.

create or replace procedure t1
is
tmp number;
begin

    select count(*)

       into tmp
       from t_customer
       where person = 'father';

end;
/

is the syntax you need.

Geoff Received on Wed Mar 17 1999 - 20:12:45 CST

Original text of this message

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