Skip to main content

Problem:

We encountered a problem on SQL Wizard when executing an ALTER TABLE ALTER COLUMN RENAME Col_odl col_new

It seems that this syntax is available from V10, Could you confirm and do you have a version of XDB compatible with DB2 V10?

Resolution:

ALTER TABLE RENAME column will work but currently in our DB2 V9 engine it only works in XDB compatibility mode. 

The following commands should be executed in SQL Wizard:

SET COMPATIBILITY XDB;

ALTER TABLE table-name RENAME old-column-name new-column-name;

SET COMPATIBILITY DB2;

Note that the TO keyword is not present in XDB mode.

It is imperative that the last statement is executed to immediately switch back into DB2 mode.  If the sessions stays in XDB mode, it can create problems.  For instance, records are stored in tables differently in XDB mode than in DB2 mode.


#RENAMECOLUMN
#EnterpriseDeveloper
#MFDS