Re: Sequences

From: MarkP28665 <markp28665_at_aol.com>
Date: 1996/08/06
Message-ID: <4u8g3q$lts_at_newsbf02.news.aol.com>#1/1


Try adding a variable to your procedure and selecting the sequence into it.

So your code -
CREATE OR REPLACE FUNCTION SA RETURN NUMBER IS    id NUMBER;
BEGIN
   RETURN sq.NEXTVAL;
END SA; becomes -
CREATE OR REPLACE FUNCTION SA RETURN NUMBER IS    id NUMBER;
BEGIN
   select sq.nextval

      into  id
      from  sys.dual;

   RETURN id;
END SA; You might need to check my typing, but this is the way you want to get around the problem. If your sequence is fairly small (low maxvalue) and was created with the nocycle option you may want to add an exception block
for 'no data found', but you probably do not need it.

Mark Powell -- The only advise that counts is the advise that you follow

  • so follow your own advise.
Received on Tue Aug 06 1996 - 00:00:00 CEST

Original text of this message