oracle/sql Creating a sequence without triggering -


I created a sequence with the beginning value as 2.

start sequence seq_ben with 2 increments by nocache noxile 1;

When I asked to show the next two numbers of that sequence

  select seq_ben.nextval from double  

And after running this code twice to give the next two values, I was asked to show the next sequence without triggering to move the next number and to add new rows in the above sequence Use the next three values. Is this possible? How can this generate a next sequence without triggering?

If you have provided a reference, you can use at least in the current session Once NXTVL .

However, I believe that if you really want to know the next number in order, then something fundamentally wrong about your design. Sequences are such designs as NexusVil is a nuclear operation, and two sessions can get the same number. Or in other words, the growing unique identifier is the guarantee that gives you. With this design, asking for the next potential value of the sequence is almost nonsensical.

You can try to use MAX () , which is often used as a poor man's solution for sequences.


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -