Interpreting Oracle's day04

interpreting oracle day04 day

– Create a simple sequence
create sequence seq_test;

– The next value of the query sequence
select seq_test.nextval from dual;
– The current value of the query sequence
select seq_test.currval from dual;

– Acyclic sequence with maximum value
create sequence seq_test1
maxvalue 20;

select seq_test1.nextval from dual;

create sequence seq_test2
increment by 10
start with 10
maxvalue 100

select seq_test2.nextval from dual;

create sequence seq_test3
increment by 10
start with 10
minvalue 5
maxvalue 100

select seq_test3.nextval from dual;

– Cyclic sequence
create sequence seq_test4
increment by 10
start with 10
minvalue 10
maxvalue 210
cycle


create sequence seq_test5
increment by 10
start with 10
minvalue 10
maxvalue 201
cycle

select seq_test5.nextval from dual;

create sequence seq_test6
increment by 10
start with 10
minvalue 10
maxvalue 100
cycle
cache 5

– How many caches are there at a time cache value * Growth value
– The value of one cycle cannot be less than Number of caches at a time

create sequence seq_test7
increment by 10
start with 10
minvalue 10
maxvalue 100
cache 20

– Create private synonyms

create synonym owner for t_owners;

select * from owner

– Create public synonyms

create public synonym OWNERS2 for t_owners

select * from OWNERS2

copyright:author[qq_ forty-five million eight hundred and forty-nine thousand tw],Please bring the original link to reprint, thank you. https://en.javamana.com/2022/02/202202130504219079.html