Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: ORACLE CURSORS
I guess I'm not understanding the Oracle terminology. What's the difference between a PL/SQL block and a stored procedure? I'm copying a sample from the book. How do you wrap this code into a stored procedure on Oracle. The book says you create a procedure by giving it a name. How do you give the PL/SQL block a name?
DECLARE
pi constant NUMBER(9.7) := 3.1415926;
radius INTEGER(5);
area NUMBER(14.2);
BEGIN
radius := 3;
area := pi*power(radius,2);
insert into AREAS values (radius,area);
END;
In article <OnO66.247145$U46.7832028_at_news1.sttls1.wa.home.com>,
"Jim Kennedy" <kennedy-family_at_home.com> wrote:
> You will want to read the section on application development pl/sql.
That
> will narrow down your search of the volume of text to deal with.
True, you
> can use dbms_sql, but it is going to be slower than defining a cursor
and a
> rowtype.
> Jim
>
> --
> Our new email address is kennedy-family_at_home.com
> Have a happy Holiday.
> <brianjh_deja_at_my-deja.com> wrote in message
> news:93ft0q$8sm$1_at_nnrp1.deja.com...
> > i'm trying to create a procedure that declares a cursor in DBA
Studio.
> >
> > CREATE OR REPLACE PROCEDURE "BRIAN"."OSP_CAPITALIZE_FIRST_CHAR" IS
> > BEGIN
> > cursor cursor1 is select * from customers;
> > END;
> >
> > Here's the generated text. But I'm getting the following error on
> > compile.
> >
> > Help would be appreciated. THANKS!!
> >
> > ERROR:
> > Line # = 3 Column # = 11 Error Text = PLS-00103: Encountered the
> > symbol "CURSOR1" when expecting one of the following:
> > := . ( @ % ;
> > Line # = 4 Column # = 1 Error Text = PLS-00103: Encountered the
> > symbol "END" when expecting one of the following:
> > begin function package pragma procedure subtype type use
> > <an identifier> <a double-quoted delimited-identifier> cursor
> > form current
> >
> >
> > Sent via Deja.com
> > http://www.deja.com/
>
>
Sent via Deja.com
http://www.deja.com/
Received on Thu Jan 11 2001 - 11:39:19 CST
![]() |
![]() |