Search This Blog

Thursday, February 11, 2010

Create database sequence in cyclic manner

I need to recycle the value in the database after reaching @ max count .. for that planned to use oracle sequences and found that following way we can recycle the sequence value from the start :

DROP SEQUENCE sms_job_seq;
CREATE SEQUENCE sms_job_seq
MINVALUE 1
MAXVALUE 100
START WITH 1
INCREMENT BY 1
CYCLE
NOCACHE;

we have to set cycle property during sequence creation .. then after reaching max limit .. (100 here) next value will start from 1. (No need of application coding to do this :) )

Cheers..

No comments:

Post a Comment

Thanks for your comment, will revert as soon as we read it.

Popular Posts