IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

DB2--can the size of the colume be changed..


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ursprasanna
Warnings : 2

New User


Joined: 15 May 2006
Posts: 20
Location: chennai

PostPosted: Wed May 17, 2006 5:26 pm
Reply with quote

I would like to know whether the size of the column be changed . if so how that can be achieved .

if not atleast the character type can be changed or not.

Thanks,
Prasanna Subramaniam.
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Sat May 20, 2006 9:17 am
Reply with quote

I think its NO... you may want to create a new table with updated structure and copy as per need.
Back to top
View user's profile Send private message
sachina2z

New User


Joined: 03 May 2006
Posts: 8
Location: Pune, India

PostPosted: Sat May 20, 2006 12:13 pm
Reply with quote

I hope the following command will solve your problem.

ALTER TABLE table_name
MODIFY column_name column_type;

For example:

ALTER TABLE supplier
MODIFY student_name varchar2(50) not null;


It will modify the column called student_name to be a data type of varchar2(50) and force the column to not allow null values.


Reply me if it works.
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Sun May 21, 2006 4:51 am
Reply with quote

Prasanna,

What is your column data type and what version of DB2 u r using.

you want to increase the length or decrease ?
Back to top
View user's profile Send private message
ursprasanna
Warnings : 2

New User


Joined: 15 May 2006
Posts: 20
Location: chennai

PostPosted: Mon May 22, 2006 10:50 am
Reply with quote

Priyesh,

The column data type is character and i am not clear about the version of DB2 which i am using.

The date base is going for an expansion so the the length of the data type has to be increased.

Thanks,
Prasanna Subramaniam.
Back to top
View user's profile Send private message
Gurmeet

New User


Joined: 22 Feb 2006
Posts: 46
Location: Pune

PostPosted: Mon May 22, 2006 3:07 pm
Reply with quote

Yes, this can be achieved if you are using DB2 V8.

Please refer the following link for find out the allowable schema changes,

www.dbazine.com/db2/db2-mfarticles/mullins-onlineschema/view?searchterm=v8 schema

Regards,
Gurmeet
Back to top
View user's profile Send private message
Gurmeet

New User


Joined: 22 Feb 2006
Posts: 46
Location: Pune

PostPosted: Mon May 22, 2006 3:10 pm
Reply with quote

giving the link again...

www.dbazine.com/db2/db2-mfarticles/mullins-onlineschema/view?searchterm=v8%20schema
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Using Java/C/C++ to retrieve dataset ... Java & MQSeries 6
No new posts Find the size of a PS file before rea... COBOL Programming 13
No new posts Masking variable size field - min 10 ... DFSORT/ICETOOL 4
No new posts Dataset size increase on adding 1 byt... DFSORT/ICETOOL 8
No new posts TWA size of the CPLT transaction CICS 0
Search our Forums:

Back to Top