Re: unique IDs - Ack!

Re: unique IDs - Ack!

 

  

That won't just renumber my table starting at 1000? I need to retain the
existing values.

Thanks!

Olsen Richard N. wrote:
> **A LazyDBA.com subscriber has responded to your lazydba.com post**
> **LazyDBA.com mail shield has forwarded you this email,
> **and removed any attachments, and kept your email address secret
> **from this person, and any viruses/trojans.
> **If you reply to this email, the person will see your email address as normal
> **Anything below this line is the original email text
>
>
> You need to recreate the table with PARTICIPANTS_ID equal to the max
> value + 1.
>
> For example, if the max value for PARTICIPANTS_ID = 1000, when you
> recreate the table use:
>
> "PARTICIPANTS_ID" INTEGER NOT NULL GENERATED ALWAYS
> AS IDENTITY (START WITH 1001, INCREMENT BY 1, NO CACHE,
> NO MINVALUE, NO MAXVALUE, NO CYCLE, NO ORDER),
>
> Good luck.
>
> -----Original Message-----
> From: Joanna Grossman
> [Email address protected]
> Sent: Thursday, May 15, 2008 5:26 PM
> To: LazyDBA Discussion
> Subject: unique IDs - Ack!
>
> Hi all -
>
> How can you retain the values in an existing ID field that's:
> "PARTICIPANTS_ID" INTEGER NOT NULL GENERATED BY DEFAULT
> AS IDENTITY (START WITH 0, INCREMENT BY 1, NO CACHE,
> NO MINVALUE, NO MAXVALUE, NO CYCLE, NO ORDER),
>
> When you want to make the IDs for new values automatically generate? I
> backed this table up and then changed it to:
>
> "PARTICIPANTS_ID" INTEGER NOT NULL GENERATED ALWAYS
> AS IDENTITY (START WITH 1, INCREMENT BY 1, NO CACHE,
> NO MINVALUE, NO MAXVALUE, NO CYCLE, NO ORDER),
>
> and as you might've guessed, it renumbered the table. ouch! So, I can
> restore, but I need to be able to insert new values w/o manually
> assigning IDs. What am I missing here?
>
> Thanks.
>
>
>
> ---------------------------------------------------------------------
> TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
> To post a dba job: http://jobs.lazydba.com
> To Subscribe : http://www.LazyDBA.com
> To unsubscribe: http://www.lazydba.com/unsubscribe.html
>
>
>

--
Joanna Grossman
Web & Data Manager
Vermont Monitoring Coop
http://www.uvm.edu/vmc

Schedule
http://sal.snr.uvm.edu/vmcdev/joannasSched


DB2 & UDB email list listserv db2-l LazyDBA home page