I need to increase the length of CD column from char(5) to char(7) in
DB2 V8.2. I am doing it this way:
1. create new_table with CD char(7)
2. do 'insert into new_table select * from Original_table'
3. drop all constraints/dependent objects on the Original_table
4. rename Original_table to Original_table_Old
5. rename new_table to Original_table
6. create all constraints and dependent objects on the Original_table
It works. But, for the larger tables, step 2 has problem. I have a
table with more than 5 million rows and 'insert into new_table select *
from Original_table' causes 'transaction log full'. Is there a way to
commit after every 10000 inserts?
I can go for EXPORT the table and IMPORT with commit count, but I don't
want to do that now. I cannot go for stored procedure either.
Is there anything like "create table new_table like original_table with
data" in DB2?
Thanks,
A C