1. Create a sequence: createsequencemyseqstartwith1incrementby1nomaxvalueminvalue1 2. initialize the sequence selectmyseq. nextvalfromdu.
Create sequence myseqstart with 1 increment by 1 nomaxvalueminvalue 1 II initialization sequence select myseq. nextval from du
1. Create Sequence
Create sequence myseq
Start with 1
Increment by 1
Nomaxvalue
Minvalue 1
Binary initialization sequence
Select myseq. nextval from dual;
It is worth noting that if you write select myseq. currval from dual directly first, a prompt will be prompted that myseq. currtval has not been defined in this session.
Sequence 3
This sequence can be used only after initialization. We use ibatis as an example.
Select myseq. nextval from dual
<BR>insert into Student(id,name,age)<BR>values(#mid#,#mname#,#mage#)<BR>
Iv. Modification Sequence
When you modify a sequence, the following values cannot be modified:
1. The initial values of the sequence cannot be modified.
The minimum value of Sequence 2 cannot be greater than the current value (currval)
3. the maximum value of the sequence cannot be smaller than the current value (currval)
Alter sequence myseq
Increment by 2
5. Delete Sequence
Drop sequence myseq
,