I would like to understand sequence report details.
In report below mentioned are the columns at sequence report
Sequence Name: Are these represent tables or Columns of table?
Initial Value: It is the starting point from where sequence begins? please confirm i am understanding this right?
Increment: value is 1 for this, it increments by one every time data inserted/
Max/Min Value: Max value the records can be stored. in my report i see '?' values, what is '?' means in report.
Cycle?: the same sequence number will be reused
Or please provide any document regarding sequence report.
> Sequence Name: Are these represent tables or Columns of table?
Sequences are the separate db objects with their own names. They can have no relations to any table or table's field
> Max/Min Value: Max value the records can be stored. in my report i see '?' values, what is '?' means in report.
'?' means the max possible value:
2,147,483,64 if the sequences are 32-bit
9223372036854775807 if the sequences are 64-bit
> Cycle?: the same sequence number will be reused
When Cycle = NO and a sequence reached Max/Min Value then NEXT-VALUE(sequence) will return the unknown value. Otherwise the values will start with Initial Value.
P.S. Documentation by the link above is incorrect regarding 'Cycle at limit".
> On Nov 13, 2019, at 6:53 AM, mboubidi wrote:
quick overview of sequences:
sequences are integer /number generators/. they are independent entities not associated with any table but the sequence values can be used to form keys in tables and for other purposes.
when you request the /next value/ from a sequence, you get back an integer that is higher than the current value by whatever the increment is set at. or lower if the increment value is negative. the value given to you is guaranteed to be yours and will not be given to anyone else (exception: if the generator is (optionally) allowed to recycle and start over when it reaches the end of its range). the next request for the next value will produce the next higher (or lower) value.
these number generators are meant to be efficient and durable and can be safely used in transactions.
there is one drawback: the sequence may have a gap if a crash occurs. this is because crash recovery cannot undo sequence operations. that is a deliberate design decision, not a bug.