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

Home -> Community -> Usenet -> c.d.o.tools -> Re: HELP me

Re: HELP me

From: <steveee_ca_at_my-deja.com>
Date: Fri, 15 Dec 2000 14:44:28 GMT
Message-ID: <91daob$tvu$1@nnrp1.deja.com>

Oh..sorry..you can only select one column into a scalar variable like this...I 'cut and pasted' too fast..instead of 'SELECT *', select one column only, or define more variables to receive column values..

Time for coffee I guess :)

Steve

In article <91d5ep$pmo$1_at_nnrp1.deja.com>,   steveee_ca_at_my-deja.com wrote:
> In article <ebo_5.108576$hk4.3928283_at_news.infostrada.it>,
> "MP" <mauro-papagno_at_libero.it> wrote:
> > I'm crazy with this Store Procedure
> > when edit the statement RUN in SQL*PLUS he tell me:
> > :
> >
> > - Procedure created with compilation errors.
> >
> > What I wrong ?
> > I try the change AS with IS , but nothing.
> >
> > HELP HELP
> >
> > Thanks and Good Work.
> > Ciao e Buon Lavoro.
> >
> > Store Procedure:
> > CREATE OR REPLACE PROCEDURE sp_prova2 (PP IN Varchar2)
> > IS
> > BEGIN
> > SELECT * FROM NEW_BC_SERVICES_FACT WHERE BC_SERVICE_NAME = PP;
> > END sp_prova2;
> > /
> > Hi,
> You need to use a different syntax. I can't describe it all here, but
> you include the 'INTO' keyword before your FROM clause. You declare a
> variable, 'v_services' for example and SELECT...INTO the variable FROM
> your table..this only works if your query returns only one row.
> You'll have to grab a book to see the syntax..anyway, as an example,
> rewrite your code something like this:

>

> CREATE OR REPLACE PROCEDURE sp_prova2 (PP IN Varchar2)
> IS
> v_services VARCHAR2(20);
>

> BEGIN
> SELECT *
> INTO v_services
>

> FROM NEW_BC_SERVICES_FACT WHERE BC_SERVICE_NAME = 'PP';
>

> END sp_prova2;
> >
> I hope this gets you started..
>

> Oh, and when you get the "compiled with errors" message, you can type
> "SHOW ERRORS" to see what the problem is..
>

> Steve
>

> Sent via Deja.com
> http://www.deja.com/

>

Sent via Deja.com
http://www.deja.com/ Received on Fri Dec 15 2000 - 08:44:28 CST

Original text of this message

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