Question & Answer
Question
How to use Sequence in SQL >> SYNTAX SELECT SEQ_YFS_....NEXTVAL FROM DUAL >>keywords Alter SEQ increment, YFC0001: record already exists Task_ID
Cause
Answer
Pick a sequence that you want to get numbers of
For e.g.,
SEQ_YFS_SHIPMENT_NO
select SEQ_YFS_SHIPMENT_NO.nextval from
dual
This will return a value 1,2,3 and so on
to Alter the
sequence use the command
alter sequence SEQ_YFS_SHIPMENT_NO increment by
201000
do the transaction
alter sequence SEQ_YFS_SHIPMENT_NO increment by
1
do the transaction and confirm it is now one up from the last
#
always remember to finish up with an increment by 1
In
extremely rare situations you might have need to reset sequence to a lower
value
This is done by
alter sequence SEQ_YFS_SHIPMENT_NO increment by
-80
followed by an incr by 1
Historical Number
PRI49317
Product Synonym
[<p><b>]Fact[</b><p>]
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21536841