sign in | join about | help | sitemap
Connecting Tech Pros Worldwide
ibm_97@yahoo.com's Avatar

Change column name in replication environment


Question posted by: ibm_97@yahoo.com (Guest) on November 12th, 2005 11:39 AM
DB2 8.2 on AIX

Hi,

I'd like to change a column's name in a table which is part of
replication.
This column is identity column (generated always).

1. Since DB2 will drop and recreate the table with the changed column
name, do I have to do something like 'set integrity off'?

2. I think I have to exclude the target table from replication, add it
back once the column name is changed. Is this correct?

Thanks a lot!

1 Answer Posted
Serge Rielau's Avatar
Guest - n/a Posts
#2: Re: Change column name in replication environment

Join Bytes! wrote:[color=blue]
> DB2 8.2 on AIX
>
> Hi,
>
> I'd like to change a column's name in a table which is part of
> replication.
> This column is identity column (generated always).
>
> 1. Since DB2 will drop and recreate the table with the changed column
> name, do I have to do something like 'set integrity off'?
>
> 2. I think I have to exclude the target table from replication, add it
> back once the column name is changed. Is this correct?
>
> Thanks a lot!
>[/color]
1. Retrieve the identity value with which you want to continue.
2. Create the new table WITHOUT the identity property.
3. LOAD the data
4. ALTER TABLE ALTER COLUMN to make the column an identity column again.

Alternatively you can use the IDENTITY OVERRIDE (sp?) option of LOAD and
alter the table to RESTART with the new value.
I have posted a stored procedure that "synchs up" identity columns after
load repeatedly in this forum.

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
 
Not the answer you were looking for? Post your question . . .
196,931 members ready to help you find a solution.
Join Bytes.com

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 196,931 network members.
Post your question now . . .
It's fast and it's free

Popular Articles

Top Community Contributors