On 04/08/2020 11:58, Adriano dos Santos Fernandes wrote:
> On 01/08/2020 12:04, Mark Rotteveel wrote:
>> I'd like to know if there are plans to fix
>> http://tracker.firebirdsql.org/browse/CORE-6084
>>

So I'm changing to set (after create / alter restart) the current value
to the initial/restarted value minus the increment.

The second example looks a bit weird but it's not inconsistent. Tested
also in Oracle and it gives the same value.

I think SET GENERATOR should not be changed, i.e., it sets current value
as informed and next value will be its value plus the increment.


SQL> create sequence s1 start with 100 increment by 10;
SQL> select next value for s1 from rdb$database;

           NEXT_VALUE
=====================
                  100

SQL> alter sequence s1 increment by 20;

SQL> select next value for s1 from rdb$database;

           NEXT_VALUE
=====================
                  120

SQL> drop sequence s1;

----------------

SQL> create sequence s1 start with 100 increment by 10;
SQL> alter sequence s1 increment by 1000;
SQL> select next value for s1 from rdb$database;

           NEXT_VALUE
=====================
                 1090


Adriano



Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to