# ALTER TABLE ALTER COLUMN

**URL:** <https://forums.toadworld.com/t/alter-table-alter-column/8189>\
**Category:** Toad for IBM DB2\
**Created:** [August 20, 2012, 10:18am UTC](https://forums.toadworld.com/t/alter-table-alter-column/8189 "2012-08-20T10:18:27Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![kumaresh\_thimma\_343](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/kumaresh_thimma_343/32/46_2.png) [@kumaresh\_thimma\_343](https://forums.toadworld.com/u/kumaresh_thimma_343)\
**Post date:** [August 20, 2012, 10:18am UTC](https://forums.toadworld.com/t/alter-table-alter-column/8189/1 "2012-08-20T10:18:27Z")

</div>

RENAME COLUMN col\_old\_name TO col\_new\_name;

However, when I try to run this DDL, I get this message "Lookup Error - DB2 Database Error: ERROR [42601] [IBM][DB2/NT64] SQL0104N An unexpected token “RENAME” was found following “tablename”. Expected tokens may include: “ALTER”.

How do I fix this?

I understand that ALTER COLUMN is not available in DB2 LUW V9.5. How do I force Toad to treat the DB as 9.5 instead of a 9.7 DB?

Thanks,  
Bob T

I’m trying to rename a column in a version 9.5.7 DB2 LUW database. I’m using ‘ALTER TABLE’ and then highlighting the column to change it to a new name. The DDL created by Toad looks like this:

ALTER TABLE tablename

---

<div class="post-metadata">

**Author:** ![Jeff\_Podlasek](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/jeff_podlasek/32/29_2.png) [@Jeff\_Podlasek](https://forums.toadworld.com/u/Jeff_Podlasek)\
**Post date:** [August 20, 2012, 12:00pm UTC](https://forums.toadworld.com/t/alter-table-alter-column/8189/2 "2012-08-20T12:00:00Z")

</div>

Bob,  
What version/edition of Toad DB2 are you using?  
thanks  
Jeff

---

<div class="post-metadata">

**Author:** ![kumaresh\_thimma\_343](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/kumaresh_thimma_343/32/46_2.png) [@kumaresh\_thimma\_343](https://forums.toadworld.com/u/kumaresh_thimma_343)\
**Post date:** [August 20, 2012, 2:19pm UTC](https://forums.toadworld.com/t/alter-table-alter-column/8189/3 "2012-08-20T14:19:00Z")

</div>

I’m using 5.0.3.718

---

<div class="post-metadata">

**Author:** ![Jeff\_Podlasek](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/jeff_podlasek/32/29_2.png) [@Jeff\_Podlasek](https://forums.toadworld.com/u/Jeff_Podlasek)\
**Post date:** [August 20, 2012, 3:04pm UTC](https://forums.toadworld.com/t/alter-table-alter-column/8189/4 "2012-08-20T15:04:58Z")

</div>

I have a DB2 9.5.0 LUW database and cannot recreate your issue using the same release of Toad DB2 you have…  
Perhaps some additional information will assist me in recreating your issue:  
Are you only altering the name of a single column?  
Is there data in that Table?  
Can you post the DDL of that table?  
Can you post the contents of Database - System General Tab (as shown in the attached).  
Thanks  
Jeff  
 ![SysGen.jpeg](https://global.discourse-cdn.com/quest/original/2X/b/b2258149bb238373f966c42d0aa87fa316f52436.jpeg)

---

<div class="post-metadata">

**Author:** ![kumaresh\_thimma\_343](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/kumaresh_thimma_343/32/46_2.png) [@kumaresh\_thimma\_343](https://forums.toadworld.com/u/kumaresh_thimma_343)\
**Post date:** [August 20, 2012, 4:08pm UTC](https://forums.toadworld.com/t/alter-table-alter-column/8189/5 "2012-08-20T16:08:38Z")

</div>

“REQ\_ETY\_MSR\_I” **INTEGER** NOT NULL,“ETY\_NM” **VARCHAR** (

“ETY\_KEY\_I” **INTEGER** NOT NULL,“PCS\_Q” **DECIMAL** (

“PCS\_BAS\_DSC” **VARCHAR** ( **30** ),“WGT\_Q” **DECIMAL** (

“WGT\_BAS\_DSC” **VARCHAR** ( **30** ),“VOL\_Q” **DECIMAL** (

“VOL\_BAS\_DSC” **VARCHAR** ( **30** ),“HGT\_Q” **DECIMAL** (

“HGT\_BAS\_DSC” **VARCHAR** ( **30** ),“LNG\_Q” **DECIMAL** (

“LNG\_BAS\_DSC” **VARCHAR** ( **30** ),“WID\_Q” **DECIMAL** (

“WID\_BAS\_DSC” **VARCHAR** ( **30** ),“PNT\_Q” **DECIMAL** (

“REC\_STT” **CHARACTER** ( **1** ) NOT NULL DEFAULT ‘A’,“CRT\_S”

“CRT\_UID” **CHARACTER** ( **8** ) NOT NULL,“CRT\_PGM\_C” **VARCHAR** (

“LST\_UPD\_S” TIMESTAMP NOT NULL,“LST\_UPD\_UID” **CHARACTER** (

“HAN\_UNT\_Q” **INTEGER** ,

)

IN "DW01581"DISTRIBUTE

COMPRESS YES;

DATA CAPTURE NONE

PCTFREE **0**

LOCKSIZE ROW

APPEND OFF

NOT VOLATILE;

ADD PRIMARY KEY

(“REQ\_ETY\_MSR\_I”, “ETY\_KEY\_I”);

Yes, I’m altering the name of a single column. There are about 14 million rows in the table.

The content of DB - System General Tab is attached.

Here is the DDL of the table:  
CREATE TABLE “CUSREQ”.“REQ\_ETY\_MSR” ( **30** ) NOT NULL, **11** , **4** ), **11** , **4** ), **11** , **4** ), **11** , **4** ), **11** , **4** ), **11** , **4** ), **11** , **4** ),TIMESTAMP NOT NULL DEFAULT , **30** ) NOT NULL DEFAULT , **8** ) NOT NULL,“LST\_UPD\_PGM\_C” **VARCHAR** ( **30** ) NOT NULL,“HAN\_UNT\_BAS\_DCS” **VARCHAR** ( **30** )BY HASH ( “ETY\_KEY\_I” )  
ALTER TABLE “CUSREQ”.“REQ\_ETY\_MSR”  
ALTER TABLE “CUSREQ”.“REQ\_ETY\_MSR”  
Thanks,  
Bob T  
 ![Toad issue 1.jpeg](https://global.discourse-cdn.com/quest/original/2X/8/8545391c8cbba5976e556ee2e538fdf18c47b59f.jpeg)

---

<div class="post-metadata">

**Author:** ![Jeff\_Podlasek](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/jeff_podlasek/32/29_2.png) [@Jeff\_Podlasek](https://forums.toadworld.com/u/Jeff_Podlasek)\
**Post date:** [August 20, 2012, 5:44pm UTC](https://forums.toadworld.com/t/alter-table-alter-column/8189/6 "2012-08-20T17:44:53Z")

</div>

Thanks for the information.  
I have opened CR 102638 to track this.

---

<div class="post-metadata">

**Author:** ![Jeff\_Podlasek](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/jeff_podlasek/32/29_2.png) [@Jeff\_Podlasek](https://forums.toadworld.com/u/Jeff_Podlasek)\
**Post date:** [August 21, 2012, 10:40am UTC](https://forums.toadworld.com/t/alter-table-alter-column/8189/7 "2012-08-21T10:40:35Z")

</div>

This issue has been fixed in Toad for DB2 v5.1.  
We are currently targeting to release that version on or about August 28, 2012.  
We will definitely post to this forum when that version is available!  
Thanks,  
Jeff

---

<div class="post-metadata">

**Author:** ![kumaresh\_thimma\_343](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/kumaresh_thimma_343/32/46_2.png) [@kumaresh\_thimma\_343](https://forums.toadworld.com/u/kumaresh_thimma_343)\
**Post date:** [August 22, 2012, 10:29am UTC](https://forums.toadworld.com/t/alter-table-alter-column/8189/8 "2012-08-22T10:29:19Z")

</div>

Okay, Thanks Jeff.
