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: Newbie Question: Simple Stored Procedure

Re: Newbie Question: Simple Stored Procedure

From: <asokol99_at_my-deja.com>
Date: Fri, 31 Mar 2000 14:38:11 GMT
Message-ID: <8c2d8i$oq6$1@nnrp1.deja.com>


In Oracle PL/SQL language you can't just have SELECT statment without INTO, or you have to use cursor. So, your stored procedure must look like this:

create or replace procedure schema.procedure as
my_rec schema.table%ROWTYPE;
begin
 select * into my_rec from schema.table; -- <- you forgot ; end;
/

and S. is right - never use reserved words...

Alex

In article <20000330141122.20362.00000042_at_ng-cn1.aol.com>, skurosky_at_aol.com (SKurosky) wrote:
> >LOUIS WROTE:
>
> >Greeting All, I have a table schema.table which has
> >many rows of data. I want to write a simple stored
> >procedure that will pull all the rows from this table;
> >
> >create or replace procedure schema.procedure
> >as
> >begin
> > select * from schema.table
> >end;
> >/
> >
> >When I run the above script I get all kinds of compilation
> >errrors?? Can anyone help me with the above procedure?
> >
> >Much Thanks, Louis
> >frolio_at_videoshare.com
> >
> >
> >Hi,
>
> Is schema.procedure, schema.table what you are actually naming
these?? If so, I
> believe they are all reserved words which will cause a whole lot of
problems.
> Give them some meaningful names.
> S
> >
> >
> >
> >
> >
>
> >
> >G
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Fri Mar 31 2000 - 08:38:11 CST

Original text of this message

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