Retrieving Information on Sequences

user_sequences view has information on your sequences. The columns in user_sequences:

ColumnTypeDescription
sequence_nameVARCHAR2(30)Name of the sequence
min_valueNUMBERMinimum value
max_valueNUMBERMaximum value
increment_byNUMBERNumber to increment or decrement sequence by
cycle_flagVARCHAR2(1)Whether the sequence cycles (Y or N)
order_flagVARCHAR2(1)Whether the sequence is ordered (Y or N)
cache_sizeNUMBERNumber of sequence values stored in memory
last_numberNUMBERLast number that was generated or cached by the sequence

The all_sequences view has information on all the sequences you have access to. The following example retrieves the details for the sequences from user_sequences:


SELECT * 
FROM user_sequences
ORDER BY sequence_name;
Home »
Oracle »
Table » 

Sequence:
  1. Creating a Sequence
  2. Retrieving Information on Sequences
  3. Using a Sequence
  4. Populating a Primary Key Using a Sequence
  5. Modifying a Sequence
  6. Using Sequences in PL/SQL
  7. Dropping a Sequence
Related: