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 -> sequence name as a variable

sequence name as a variable

From: Sravan <beingmeus_at_yahoo.com>
Date: 18 Oct 2001 17:33:07 -0700
Message-ID: <e2a16bc8.0110181633.3e5eb57a@posting.google.com>


Hello,
I was wondering if I can use sequence name as a variable in a function. I want to pass the seq. name as a input parameter to a function. Lets say :

CREATE FUNCTION test_func

   (seq_name varchar2)
  return number;
IS
  temp_value number;
BEGIN
  select seq_name.nextval into temp_value from dual;   return temp_value;
END;
/

When I execute this function, am getting an error saying "Invalid reference to variable 'SEQ_NAME' "

So, my Question is how do I pass the name of seq. as parameter and get the next value of the sequence ?

Thanks
-Sravan Received on Thu Oct 18 2001 - 19:33:07 CDT

Original text of this message

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