| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: PL/SQL Declare and Define a variable
"Tony Andrews" <andrewst_at_onetel.com> wrote in message
news:1096471106.801349.260410_at_k17g2000odb.googlegroups.com...
> Oxnard wrote:
> > I'm just wondering if there's anyway to do this, I guess it could
> help
> > readability.
> >
> > if I have a procedure:
> >
> > create or replace procedure test as
> > v_test NUMBER := 25; -- Works no big deal
> > v_test1 NUMBER := select my_valid_sequence.nextval from dual;
> -- does
> > not work
> > BEGIN
> > -- So I end up doing with v_test1 properly defined
> > select my_valid_sequence.nextval into v_test1 from dual;
> > END;
> > /
> >
> > The "select my_valid_sequence.nextval into v_test1 from dual;" is OK
> but it
> > seems to me the code would be a bit easier to read if I could Define
> the
> > variable in the declarative section. My question is without using a
> cursor
> > can a select be put into the declarative section?
>
>
>
>
>
>
>
I was thinking about that ... Thanks for the advice Received on Wed Sep 29 2004 - 18:28:00 CDT
![]() |
![]() |