Re: don't use all_sequences !

From: Gerd Volberg <gerd.volberg_at_netcologne.de>
Date: Tue, 04 Aug 1998 22:14:06 +0200
Message-ID: <35C76B8E.2DD3F5E_at_netcologne.de>


Youīre right with your increment by 1, but on the other side, when you search for currval and havenīt used nextval in your session, you have no chance to get the value. OK, Use nextval - 1, but then you have holes in your sequence and many projects needs them without holes!

So, when you have only one session, and you have only one procedure for getting and using this sequence, than you can use the all_sequences, with all its problems. But, and thatīs the normal way, you first have something to insert in a parent table. Afterthere you have to insert a child-record with the ID of the parent. In this case you should use a local variable!

    SELECT seq_1.nextval

      INTO var_seq_1
      FROM dual;

MfG
  Gerd Volberg Received on Tue Aug 04 1998 - 22:14:06 CEST

Original text of this message