Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> PL/SQL Declare and Define a variable

PL/SQL Declare and Define a variable

From: Oxnard <shankeyp_at_no-spam.comcast.net>
Date: Wed, 29 Sep 2004 09:59:40 -0500
Message-ID: <Qq-dnTOWgvZkUcfcRVn-ug@comcast.com>


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

Original text of this message

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