This is a discussion on Change column name in replication environment within the DB2 forums, part of the Database Server Software category; --> DB2 8.2 on AIX Hi, I'd like to change a column's name in a table which is part of ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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! |
| ||||
| ibm_97@yahoo.com wrote: > 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. 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 |
| Thread Tools | |
| Display Modes | |
|
|