RE: Auto Generated Keys

RE: Auto Generated Keys

 

  

Even if you invent a way to do this I don't think you would like the
effect because the delete of one row, KEY # 1 for example, would cause a
cascade update to every key row in the table.

My question - can't the data remain "Key 1,3,4,5..." when #2 is deleted?

It is still unique and still in order.

-----Original Message-----
From: Ruben Prakash D
[mailto:db2udbdba-ezmlmshield-x69088801.[Email address protected]
Sent: Saturday, May 28, 2005 8:47 AM
To: LazyDBA Discussion
Subject: Auto Generated Keys

I want to create a table with a surrogate key (auto incremented) as a
primary key. Is there any function that is available in DB2 so that when
I
delete a row from the table it will adjust the key? For example if my
table
contains rows in a order



Key

---

1

2

3



If the row #2 is deleted then order should be



Key

---

1

2



Will it be possible in DB2?



Thanks & Regards,

Ruben Prakash Durairajulu

US Technology

Office: +91-471-2335777(Extn: 2479)

Mobile: +91-98951-36027
Fax: +91-471-2527276


<http://ustri.com/> http://ustri.com

Disclaimer:This e-mail and any files transmitted with it are for the
sole
use of the intended recipient(s) and may contain confidential and
privileged
information. If you are not the intended recipient, please contact the
sender by reply e-mail and destroy all copies of the original message.
Failure to maintain the confidentiality of this e-mail and any
attachment
may subject you to penalties under applicable law..







---------------------------------------------------------------------
PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
website: http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html


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