Updating Primary Key

Darren Kilpatrick

Updating Primary Key
I need to update the columns in the primary key of a parent table. Should I
run the update, or should I run a delete/insert? We are on DB2 Version 8 for
z/OS


______________________________________________________________________

* IDUG 2009 Rome, Italy * 5-9 October * http://IDUG.ORG/Events *
______________________________________________________________________



IDUG.org was recently updated requiring members to use a new password. You should have gotten an e-mail with the temporary password assigned to your account. Please log in and update your member profile. If you are not already an IDUG.org member, please register at http://www.idug.org/component/juser/register.html

Troy Coleman

Re: Updating Primary Key
(in response to Darren Kilpatrick)
I would handle it as an update.
It used to be an issue if you had the table partitioned and you wanted
to change the columns used in the partitioning limit keys.
But that was changed through zparm support to allow for updates on the
limit key.

I have not done any performance testing on an update versus delete/insert.
But I would think the delete/insert will cost you more since that is two
trips to DB2 versus one.

Troy Coleman

Darren Kilpatrick wrote:
> I need to update the columns in the primary key of a parent table. Should I
> run the update, or should I run a delete/insert? We are on DB2 Version 8 for
> z/OS
>
>
> ______________________________________________________________________
>
> * IDUG 2009 Rome, Italy * 5-9 October * http://IDUG.ORG/Events *
> ______________________________________________________________________
>
>
>
> IDUG.org was recently updated requiring members to use a new password. You should have gotten an e-mail with the temporary password assigned to your account. Please log in and update your member profile. If you are not already an IDUG.org member, please register at http://www.idug.org/component/juser/register.html
>
>


______________________________________________________________________

* IDUG 2009 Rome, Italy * 5-9 October * http://IDUG.ORG/Events *
______________________________________________________________________



IDUG.org was recently updated requiring members to use a new password. You should have gotten an e-mail with the temporary password assigned to your account. Please log in and update your member profile. If you are not already an IDUG.org member, please register at http://www.idug.org/component/juser/register.html

Cathy Taddei

Re: Updating Primary Key
(in response to Troy Coleman)
I don't think that will work for tables created before the zparm PARTKEYU was introduced in v5 -- the UPDATES column in SYSCOLUMNS would have been set to 'N' for partitioning key columns back then. There is a way to change that without dropping and recreating the table, but I haven't tried it yet.

Regards,
Cathy Taddei

-----Original Message-----
From: DB2 Data Base Discussion List [mailto:[login to unmask email] On Behalf Of Troy Coleman
Sent: Thursday, January 15, 2009 2:06 PM
To: [login to unmask email]
Subject: Re: Updating Primary Key

I would handle it as an update.
It used to be an issue if you had the table partitioned and you wanted
to change the columns used in the partitioning limit keys.
But that was changed through zparm support to allow for updates on the
limit key.

I have not done any performance testing on an update versus delete/insert.
But I would think the delete/insert will cost you more since that is two
trips to DB2 versus one.

Troy Coleman

Darren Kilpatrick wrote:
> I need to update the columns in the primary key of a parent table. Should I
> run the update, or should I run a delete/insert? We are on DB2 Version 8 for
> z/OS
>

------------------------------------------------------------------------------

This email is confidential and may be legally privileged.

It is intended solely for the addressee. Access to this email by anyone else, unless expressly approved by the sender or an authorized addressee, is unauthorized.

If you are not the intended recipient, any disclosure, copying, distribution or any action omitted or taken in reliance on it, is prohibited and may be unlawful. If you believe that you have received this email in error, please contact the sender, delete this e-mail and destroy all copies.

=====


______________________________________________________________________

* IDUG 2009 Rome, Italy * 5-9 October * http://IDUG.ORG/Events *
______________________________________________________________________



IDUG.org was recently updated requiring members to use a new password. You should have gotten an e-mail with the temporary password assigned to your account. Please log in and update your member profile. If you are not already an IDUG.org member, please register at http://www.idug.org/component/juser/register.html