| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.tools -> Re: HELP me
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/
Received on Fri Dec 15 2000 - 07:14:05 CST
![]() |
![]() |