how to restart sequence number ?!
Posted in 2010
Topics: General Discussion
Dear All...
I try to utilize sequence object of IDS 11.50.uc6 in my application ,
Suppose I create a sequence like the following :
CREATE SEQUENCE seq_2
INCREMENT BY 1 START WITH 1
MAXVALUE 3000000 MINVALUE 0
CYCLE ;
But if I like the seq_2 to restart from 1 on every monday morning ,
no matter what number it is on sunday , maybe 1000 , 20000 perhaps,
except for drop sequence and recreate it , what sql can I use
to initialize the seq_2 to start with 1 again ?!
ALTER SEQUENCE seq_2 RESTART [WITH N]
http://publib.boulder.ibm.com/infocenter/idshelp/v115/topic/com.ibm.sqls.doc/ids
_sqs_0281.htm
Regards.
On Mon, Feb 22, 2010 at 10:34 AM, MARS CHEN <mars@jsun.com> wrote:
> Dear All...
>
> I try to utilize sequence object of IDS 11.50.uc6 in my application ,
> Suppose I create a sequence like the following :
>
> CREATE SEQUENCE seq_2>
> INCREMENT BY 1 START WITH 1
>
> MAXVALUE 3000000 MINVALUE 0
>
> CYCLE ;
>
> But if I like the seq_2 to restart from 1 on every monday morning ,
> no matter what number it is on sunday , maybe 1000 , 20000 perhaps,
> except for drop sequence and recreate it , what sql can I use
> to initialize the seq_2 to start with 1 again ?!
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--
Fernando Nunes
Portugal
http://informix-technology.blogspot.com
My email works... but I don't check it frequently...
--0016367fae4d096fae04802e5034