Unix Technical Forum

ALTER TABLE ... ALTER COLUMN ... SET DATA TYPE

This is a discussion on ALTER TABLE ... ALTER COLUMN ... SET DATA TYPE within the DB2 forums, part of the Database Server Software category; --> This should be easy in DB2. The statements below work in v8. If they fail on your v7 system, ...


Go Back   Unix Technical Forum > Database Server Software > DB2

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #11 (permalink)  
Old 02-26-2008, 04:00 PM
Blair Adamache
 
Posts: n/a
Default Re: ALTER TABLE ... ALTER COLUMN ... SET DATA TYPE

This should be easy in DB2. The statements below work in v8. If they
fail on your v7 system, you should have the PMR reopened and get an APAR:

C:\tmp> db2 create TABLE ELMT_T (CDTY_CD varchar(48))
DB20000I The SQL command completed successfully.

C:\tmp>db2 create view elem2 as select cdty_cd from elmt_t
DB20000I The SQL command completed successfully.

C:\tmp>db2 ALTER TABLE ELMT_T ALTER COLUMN CDTY_CD SET DATA TYPE VARCHAR(51)
DB20000I The SQL command completed successfully.

Jane wrote:

> Spoke to someone from IBM and I am told that if there is a view on the
> table, the table columns cannot be extended.
>
> Solution:
> -Drop the view
> -ALTER the table and Extend the varchar column.
>
> Nothing is easy in DB2 ...
>
> Thanks for everyone's input.
> -Jane


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:44 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com