programmera.net -> oracle -> normal för utskrift | info@programmera.net |
USER_SEQUENCES
1. USER_SEQUENCES 2. Exempel |
1. USER_SEQUENCES
Man kan se sina sekvenser i tabellen USER_SEQUENCES. Nedan listas alla kolumnerna:
SQL> DESC user_sequences;
Namn Null? Typ
----------------------------------------- -------- ----------------------------
SEQUENCE_NAME NOT NULL VARCHAR2(30)
MIN_VALUE NUMBER
MAX_VALUE NUMBER
INCREMENT_BY NOT NULL NUMBER
CYCLE_FLAG VARCHAR2(1)
ORDER_FLAG VARCHAR2(1)
CACHE_SIZE NOT NULL NUMBER
LAST_NUMBER NOT NULL NUMBER
2. Exempel
Nedan listar det senaste använda numret för alla våra sekvenser (här har vi bara en sekvens i schemat):
SQL> SELECT sequence_name, last_number FROM user_sequences;
SEQUENCE_NAME LAST_NUMBER
------------------------------ -----------
SEQ_MY_OWN 21