Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> PL/SQL Declare and Define a variable
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
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?
Thanks Received on Wed Sep 29 2004 - 09:59:40 CDT