If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Alter table Alter column

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-27-04, 04:19
Paingiver Paingiver is offline
Registered User
 
Join Date: Feb 2004
Posts: 14
Alter table Alter column

Version IBM DB2 Personal Edition 7.?? and IBM DB2 Server Edition 7.??

Got all the patch.

Command -
ALTER TABLE table_name ALTER COLUMN "column_name" SET DATA TYPE DECIMAL(9,3)

and

ALTER TABLE table_name ALTER COLUMN "column_name" DECIMAL(9,3)

error -
DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor. During SQL processing it returned: found following "BEGIN-OF-STATEMENT". Expected tokens may include: "<values>". SQLSTATE=42601

I'm trying to alter a column from a Decimal (5,0) to a Decimal(9,3) there are value in the column.
Reply With Quote
  #2 (permalink)  
Old 04-27-04, 04:24
Tank Tank is offline
Registered User
 
Join Date: Feb 2004
Location: Copenhagen
Posts: 220
Unhappy

Hi

I don't think you can alter columns like that,
and especially not i version 7.

I think you will hav to move data to a new table
with the requuired columns, drop the old table and
rename the new.

Some say that the new DB2 version - Stinger will make
this possible

HTH
__________________
Kristian K. Hansen
Project Supervisor
National Board of Health
Reply With Quote
  #3 (permalink)  
Old 04-27-04, 05:15
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
You can add a column, but you can only alter the length of a varchar on DB2 for Linux, UNIX, and Windows.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #4 (permalink)  
Old 04-27-04, 19:17
Paingiver Paingiver is offline
Registered User
 
Join Date: Feb 2004
Posts: 14
Thank You all for your advice.
Reply With Quote
  #5 (permalink)  
Old 04-27-04, 23:47
unfire unfire is offline
Registered User
 
Join Date: Apr 2004
Location: Shenzhen
Posts: 8
in db2 , you cann't change the most column property , only can change the varchar length .etc .
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On