Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help DB2-Alter

Status
Not open for further replies.

MatteoC

Programmer
Jul 14, 2006
2
IT
Hi all,
i'm working on a project and i need to change in a table of the db the data-type of a column this column is type Decimal(19,2) and i need to change it in Varchar(512) without drop and rebuild the table or the column.

it is possible to do it with a query in DB2? (like alter table .... alter .... set data type...)

If yes can you write me the query?
thx
 
I do not believe that is possible (if someone knows otherwise, please post). Is recreating the table off hours out of the question? You could save the data on a temporary table and then insert it back into the original table after you have recreated it. How large is this table?
 
I have yet tried it in a test db but it give me constraint errors ... i'm working on it
 
If you can determine which constraints they are, you can temporarily disable them and then enable them when you are done.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top