Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2012
    Posts
    24

    Unanswered: To reseed identity column value starting from 1 evary day..

    Hi,

    I am using IBM data studio z/OS 10.

    I have one requirement like,in a table there is one identity column created.
    For the first day 1000 records inserted into the table and the identity column value started from 1 to 1000 but next day while records got inserted then the identity column value SHOULD NOT start with 1001,it should again start from 1 onwards.that means evary day identity column value should start from 1 onwards.

    Can anyone please suggest me how i can achive this?
    Last edited by rkp; 10-11-12 at 06:36.

  2. #2
    Join Date
    May 2009
    Posts
    508
    Provided Answers: 1
    rkp, you might do better with a SEQUENCE object. It can be Altered back to the starting value.

  3. #3
    Join Date
    Aug 2012
    Posts
    24
    Thanks for ur reply.

    Alter sequence <seq_name> restart with 1;
    Can altering a sequence be used inside a stored procedure?

    Please suggest.

  4. #4
    Join Date
    May 2009
    Posts
    508
    Provided Answers: 1
    rkp, Alter Sequence can be included in a Stored Procedure.

  5. #5
    Join Date
    Aug 2012
    Posts
    24
    Thank for your reply.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •